changed where global Maze variable is updated.