q-sort binary