Fixed infinite loop in timetable generation

Started working on jsdoc