simplified threaded binary tree traversal