updated scheduler
reverting crap chagne
Made some performance improvements and added some debug code