how to simplify a tree