refactored based on Abi's code review
Merge pull request #47 from sgray11/code_review

refactored based on Abi's code review