created extra disjoint set to keep track of flow