subtle adjustment of quick sort