implement A* pathfinding

completely untested!