Create static mergeCourses function