disjoint sets plugin, version that does not crash..