add a very simple state machine