Finding Remainder Using Modular Arithmetic