implement BinaryTree