Adding more pathfinding related codes.