Changed code to print 500 primes