use a foreach on the primes, rather than a counting down for