adding comments to clarify code

adding comments to clarify code