quicksort with duplicates but crash with palindromes