Added a new filter method to the Trie