improving findPrimes loop