oops, can't sort array_values result, need to sort by reference