Added more comments to the pathfinding code