working on strongly connected components problem