code: public int findMax(PairDblInt[] cols) {
  	int maxIdx = 0;
  	double maxVal = -1.0;
  	
  	for (int i = 0; i < numLabels; i++) {
  	    if (cols[i].first > maxVal) {
  		maxVal = cols[i].first;
  		maxIdx = i;
  	    }
  	}
  	
  	return maxIdx;
      }
docs: Find max.
  
  @param cols the cols
  @return the int