first version of quicksort algorithm