added some comments to explain the code