altered quicksort to choose the first element of the vector as pivot