code cleanup.
Comments added.
Merge pull request #160 from Asitha/code-cleanup

Code cleanup