added comments to helper functions