Added in comments to the code