Maze pathfinding data structure stack implementation