added comments to clarify intentions