Here's the fsm.