Adding path condition and fixing math logic for computing semesters