updated sorting for candidates