added tree functionality to treeview.