partial implementation of binary_tree