added timetable logic