used cumulative probability for ordering