qsort generator modified