understand tree traversal