change partition for quick sort