initial code for saving the schedule