Defining main quicksort functions