Adding tests; refactoring rounding; formatting changes
Refactoring, adding tests, documentation