Added one pass connected components, not yet tested