added comments to various functions