sort the dictionary