final version of Primes