finish generic quick sort