Tighten up code for reuse of isPrime and the Sieve of Eratosthenes for finding primes.