solved #10, optimized sieve in 7