refine quick sort