completed the basic functionality of the tree view