Adding more comments to code for clarity