primes functionality