added comments to the function.