fixed union and currentCost for disjoint sets