in modular primes, simplified code