folding maze: bug fix*n+1

bug fix*n+1