Modulus function and unit test