added comments to the functions