quick sort (correct count)