Added comments to explain modifications