Added new function to buildCalendar