Added suffix array.
Wrap some lengthy code.