More correct version of strongly connected components with UnionFind, but still not quite there ...