Added initial code for the scheduler.