solution to bonus maze_solver