reimplmeent as a sieve