code clean up and necessary comments added
Merge pull request #26 from g3-ks/branch_alshahna

code clean up and necessary comments added