Added semester class and changed for loops of validity checker.