add some suffix array code