Begun to write the schedule code