Refactored code to clean and condense it
Refactored code to clean and condense it
Removed duplicate code
Merge pull request #3 from alexschneider/master

Condense and refactored