Maze now generated correctly

Changed set-lookup to check vs root and while-loops conditions has been
restrained