Moved into function
Merge pull request #4 from jacobperron/master

Jacob moved it into a function. I'll take his word for it that it works