Refactored script
Merge pull request #1 from adambarber/master

Refactored Script to be more flexible