better version of sane sorting [#67982294]