Sort the dictionary