handle zero
use remainder to get exact value to divide by, saving a call to Math lib
add some tests
Merge pull request #2 from QubitProducts/tweaks

Tweaks