maze generation and rotation