Update createBinaryTree function