Adding modulus

passes tests