Merge pull request #1 from polewskm/working

Working
Added tests and some minor cleanup
Merge pull request #2 from polewskm/working

Added tests and some minor cleanup
Merge pull request #2 from polewskm/master

Updated unit tests and minor cleanup