add current char calculation to state machine