Fixed the return value for the generateSchedule function.