Added a function with a filter argument. Buggy.