Delete unused function sort_rules()