Initial state machine implementation