Adjusted clear function and set up e-mail so that it uses generateDates()