sorting the PMF