created updateCalendar() function