added efficient getCourses