updated quick sort