.value;
            if (state === prevState) {
              duplicates++;
            }
            else {
              trace(state);
              prevState = state;
              duplicates = 0;
            }

            if (duplicates === duplicateThreshold) {
              output(state);
            }
            window.setTimeout(iteration, 1);
          };
          iteration();
        };
        decode();

        document.querySelector('button').addEventListener('click', (e) => {
          docum