added modulus, tested output