Sorting distance values alphabetically