firts approximation of the sieve
small optimization to the code