Pathfinding function addition