Code for generating mazes