Now using the tree to match