Implemented disjointset partially