little cleaner solution for the primes