code changes relay states