implementing modulus