code: private void calcHiLoValues(double y, int index) {
          if (y < lo) {
              lo = y;
              loIndex = index;
          }
  
          if (y > hi) {
              hi = y;
              hiIndex = index;
          }
      }
docs: Calculates the max and min measured values and stores the index of the
  related values in in loIndex and hiIndex.
  @param y
  @param index