implemented copyOf(Tree) method to clone Trees