totally legit implementation and example of astar