additional comments

added more comments to make functions easier to read