add unit 3-13
use modulo instead of the plain % operator to combat negative domains and ranges