This commit adds comments to each function.