added comments to pathfinding