finding strongly connected components