refactored code
Merge pull request #65 from sgray11/refactor

refactored code