added tests, slight refactoring of code
rolling out 1.0.3