optimizing schedules