Basic state machine system