Starting logic for primes loop