refactored the doomed() function in the sieve example