private static void handleSCC(File f){
        Digraph G = new Digraph(new In(f));
//        StdOut.println(G.toString());
        TarjanSCC TSCC = new TarjanSCC(G);

        // number of connected components
        int M = TSCC.count();

        // compute list of vertices in each strong component
        Queue<Integer>[] components = (Queue<Integer>[]) new Queue[M];
        for (int i = 0; i < M; i++) {
            components[i] = new Queue<Integer>();
        }
        for (int v = 0; v < G.V(); v++) {
            components[TSCC.id(v)].enqueue(v);
        }
        
        // verify that all scc is correct
        assert VerifySCC(f);
        
        // store scc to .scc files
        Out out = new Out(f.getAbsolutePath() + ".scc");
        for (int i = 0; i < M; i++) {
            for (int v : components[i]) {
                out.print(v + " ");
            }
            out.println();
        }
        out.close();
        
        // generate new graph based on index of SCCs
        Digraph Gscc = new Digraph(M);
        for(int i = 0; i < M; i++){
            int v = i;  // super node v to represent SCC i
            Queue<Integer> scc = components[i];
            for(int oldv : scc){
                for(int oldw : G.adj(oldv)){
                    int w = TSCC.id(oldw);
                    if(w == v) continue;    // in the same SCC
                    Gscc.addEdge(v, w);
                }
            }
        }
        
//        StdOut.println(Gscc.toString());
        Data.storeDigraph(Gscc, new Out(f.getAbsolutePath() + ".sn"));
    }