wrote quick sort algorithm