added comments to clarify what the methods do