More efficient primes algo and better task ranges