connected components using dfs done