completed nlogn suffix array construction