Reworked OPTStateMachine to work with input strings