Scheduling code added