Performance tweaks

Improved primes package to reduce time taken to get prime numbers