added union-find to the data collection