update iterative tree traversal