replace the print in the loop with a ordered dict
then the ordered dict is sorted and printed