Correction in the PUT function.
Added:
1. Adding comments to code
2. Listing changes on review