Getting the scheduler working