code: private double[] formatTargetValuesForOptimizer() {
  		//Put all values in an array for the optimizer.
  		int numberOfMaturities = surface.getMaturities().length;
  		double mats[] = surface.getMaturities();
  
  		ArrayList<Double> vals = new ArrayList<Double>();
  
  		for(int t = 0; t<numberOfMaturities; t++) {
  			double mat = mats[t];
  			double[] myStrikes = surface.getSurface().get(mat).getStrikes();
  
  			OptionSmileData smileOfInterest = surface.getSurface().get(mat);
  
  			for(int k = 0; k < myStrikes.length; k++) {
  				vals.add(smileOfInterest.getSmile().get(myStrikes[k]).getValue());
  			}
  
  		}
  		Double[] targetVals = new Double[vals.size()];
  		return ArrayUtils.toPrimitive(vals.toArray(targetVals));
  	}
docs: This is a service method that takes care of putting al the target values in a single array.
  @return