addPeriodTime function now accounts for overtime periods appriopriately