improved quick sort