Some (non-working) RX code.  State change code appears to be giving problems.