Updated the SpanningTree class.