hacked together the improved filter implementation