Modified function binaryTreeTraverseInOrder