added BinaryTree; refactoring