Refactored code with comments
Merge pull request #1 from pdw207/master

Refactored code with comments