Commented current code

added comments to each line of code.