Code to get modulus pairs