fix to Sieve of Eratosthenes algorithm