Group and Sort Alphabetically I have a list of categories that I am listing out, grouping by alphabet.  The issue is the list goes A H B C D E...and so on.  Why would it go in that order?

{% set categories = craft.categories.group('programs') %}

{% set categoriesGroup = categories|group('title|slice(0, 
1)|replace("/[^a-zA-Z]/", "0-9") | upper') %} 
&lt;ul&gt;
{% for letter, categoriesInGroup in categoriesGroup %}
{{ letter }}
{% for category in categoriesInGroup %}
  &lt;li&gt;{{ category.title }}&lt;/li&gt;
{% endfor %}

{% endfor %}
&lt;/ul&gt;
Seems I needed to put in the order filter

{% set categories = craft.categories.group('programs').order('title') %}

{% set categoriesGroup = categories|group('title|slice(0, 
1)|replace("/[^a-zA-Z]/", "0-9") | upper') %} 
&lt;ul&gt;
{% for letter, categoriesInGroup in categoriesGroup %}
{{ letter }}
{% for category in categoriesInGroup %}
  &lt;li&gt;{{ category.title }}&lt;/li&gt;
{% endfor %}

{% endfor %}
&lt;/ul&gt;