finished sieve method with comments