correcting A* search