Added disjoint set data structure