Rewritten PCM loop, added constraint classes and added them to course.