Implemented changes made by z5h
2.1.0
Brought in changes made by z5h. This is a total refactor, and  removes the need for sending variables in as params.
3.0.0