folding maze: bug fix*n+2

bug fix*n+2