Small FSM simulator