code: private int mapIndexToAction(int index) {
      if (index < buttonCount) {
        int count = -1;
        for (int x = 0; x < MAX_BUTTON_COUNT; x++) {
          if (fields[x]) {
            count++;
          }
          if (count == index) {
            return x;
          }
        }
      }
      return -1;
    }
docs: positions, based on which fields are present in this barcode.