Add sort function to $str

Ensures that the category_result displays in alphabetical order.