slight performance improvement of Disjoint set implementation