this is a rough first round implementation of the bciStateMachine.