updated script with type and isHoliday methods