Further additions to sortByCourseOrder