More updates to timetable generation algorithm