Provided clearer comments to code for learning purposes