Updating the overall algorithm to generate the schedule.