updated buildMaze