wrapped a class around the functions
added some return statements and finished refactor
removed refactor from todo
Merge pull request #1 from psmagicman/refactor

Refactored the script into a class and added return statements with error checks