The A* algorithm you wrote!