Revert "filter function modified and tested"

This reverts commit 94522435dc5345f2cb3c0ead80e17baf0143824e.