Performed the modulus without using div