Rewrite schedule into one program.