modified code in binarytree