sort departments and courses