fix integer overflow
quick sort implementation