Added filteredTree()

Modified using Jan's improvements.
Hopefully this time i did it right.