Updated relay.c to work with the payload.