Added comments to explain what I did