Added the ability to filter from a custom function