added some helper fucntion to efficiently schedule courses