Ugly, but it works. Maze now generates.