NewGenCount = GenCount + 1,
SortedStatePairs = lists:sort(NewStatePairs),
StateChars = [state_to_char(S) || {_, S} <- SortedStatePairs],
NewGenCount = GenCount + 1,
SortedStatePairs = lists:sort(NewStatePairs),
StateChars = [state_to_char(S) || {_, S} <- SortedStatePairs],