tests and filtering

I think this part should go in an else so it's clear that there are two cases.