Added comments to clarify what is being done