Implement filter. Add tests.