fixed so that each part of the maze is visited