tweaked filter.py and test_filter.py