Re: State machine implementation