A* (a star) implementation