Adding scheduler stuff for main2