Beginning of the pathfinding