Maze Sovler in Python