add pruning to tree utilities