eliminated dup lines in resetDates function