Add sort_by feature.