Fixed and checked quicksort for the whole buffer,it works correctly