fixed qsort example