modified fsm_... to get rid of inferred latch