Improve sorter_rank