Add comments to A* function