added dump() and switch_tree()