SCC O(nlogn) alg, correct and fast for big n!