MQ without qsort