changed filter.py to be more modular