merged more of the old schedule code, not working