complete the binaryTree Train function