(1) fix reordering_freq_to_prob (2) fix formatting