Changes to the scheduler, partially complete, still needs more testing.