Implemented relay control.