begin of function timetable_exists