Comments added

Added some comments to make it easier to scan the code.