Maze solving algorithm implemented.