update quicksort with generic type