Add basic function of tree traversal