state machine prototyped