modified binary_tree.cpp