Rework code
Merge pull request #27 from bhatfield/master

Rework code