minor change, could still be faster with a "is prime" function probably than searching for if in primes