Finished coding L1 state machine