optimize the tree pic