add Union find data structure.