adds sorting for the courses page