Added thread to calculate primes in background