tested binary tree traversal