change quicqsort to return result array