Added functionality to walk the tree.