Implementing sieve for primes