pathfinding ok, needs cleanup for use