Added comments to a pile of high-level functions