State machine prototipe