refactored TestKosaraju