Functionnal pathfinding.