Initial logic for Pathfinding.