Added logic to the class that will store trees composed of nodes and
leaves.