untested connected components algo.