Added some actual code to the scheduler