fixed bug with generation that would generate primes one more than the limit