Elinas sorting functions lifted from NewScoreEquations