some mods to disjoint-set