reduced indent and converted to proper disjoint set.