New version of schedule.c