Implemented a potentially more stable maze generation algorithm.