Sorted the list of states in the output template.