Working on scheduling
Scheduling function
Fixed merge conflicts