Added primes algorithm