Changed Logic for dynamic generation of maze.

By changing the level we can dynamically generate the maze now.