more correct sortdigits