Cleaned up filter.pl