implementing treeview and tree iterator