initial pathfinding functionality