FSM for controlling Pattern insertion.