Sieve.
Small tests.
Neater version.