added second, reversed, SA. doesn't work yet
faster implemenation using 2 suffix arrays and looking for the contents of one (reversed) in the other by order of longest to shortest. still too slow.
the part that is too slow is building of the suffix array, need to use the ranking pair method
changed sorting method, a little faster, still too slow
code works for small strings