implementation of schedule code