docs: public RandomVariableInterface[] getBasisFunctions(double exerciseDate, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
  
  		ArrayList<RandomVariableInterface> basisFunctions = new ArrayList<RandomVariableInterface>();
  
  		RandomVariableInterface basisFunction;
  
  		// Constant
  		basisFunction = model.getRandomVariableForConstant(1.0);
  		basisFunctions.add(basisFunction);
  
  		// LIBORs
  		int liborPeriodIndex, liborPeriodIndexEnd;
  		RandomVariableInterface rate;
  
  		// 1 Period
  		basisFunction = model.getRandomVariableForConstant(1.0);
  		liborPeriodIndex = model.getLiborPeriodIndex(exerciseDate);
  		if(liborPeriodIndex < 0) {
  			liborPeriodIndex = -liborPeriodIndex-1;
  		}
  		liborPeriodIndexEnd = liborPeriodIndex+1;
  		double periodLength1 = model.getLiborPeriod(liborPeriodIndexEnd) - model.getLiborPeriod(liborPeriodIndex);
  
  		rate = model.getLIBOR(exerciseDate, model.getLiborPeriod(liborPeriodIndex), model.getLiborPeriod(liborPeriodIndexEnd));
  		basisFunction = basisFunction.discount(rate, periodLength1);
  		basisFunctions.add(basisFunction);//.div(Math.sqrt(basisFunction.mult(basisFunction).getAverage())));
  
  		basisFunction = basisFunction.discount(rate, periodLength1);
  		basisFunctions.add(basisFunction);//.div(Math.sqrt(basisFunction.mult(basisFunction).getAverage())));
  
  		// n/2 Period
  		basisFunction = model.getRandomVariableForConstant(1.0);
  		liborPeriodIndex = model.getLiborPeriodIndex(exerciseDate);
  		if(liborPeriodIndex < 0) {
  			liborPeriodIndex = -liborPeriodIndex-1;
  		}
  		liborPeriodIndexEnd = (liborPeriodIndex + model.getNumberOfLibors())/2;
  
  		double periodLength2 = model.getLiborPeriod(liborPeriodIndexEnd) - model.getLiborPeriod(liborPeriodIndex);
  
  		if(periodLength2 != periodLength1) {
  			rate = model.getLIBOR(exerciseDate, model.getLiborPeriod(liborPeriodIndex), model.getLiborPeriod(liborPeriodIndexEnd));
  			basisFunction = basisFunction.discount(rate, periodLength2);
  			basisFunctions.add(basisFunction);//.div(Math.sqrt(basisFunction.mult(basisFunction).getAverage())));
  
  			basisFunction = basisFunction.discount(rate, periodLength2);
  			//			basisFunctions.add(basisFunction);//.div(Math.sqrt(basisFunction.mult(basisFunction).getAverage())));
  
  			basisFunction = basisFunction.discount(rate, periodLength2);
  			//			basisFunctions.add(basisFunction);//.div(Math.sqrt(basisFunction.mult(basisFunction).getAverage())));
  		}
  
  
  		// n Period
  		basisFunction = model.getRandomVariableForConstant(1.0);
  		liborPeriodIndex = model.getLiborPeriodIndex(exerciseDate);
  		if(liborPeriodIndex < 0) {
  			liborPeriodIndex = -liborPeriodIndex-1;
  		}
  		liborPeriodIndexEnd = model.getNumberOfLibors();
  		double periodLength3 = model.getLiborPeriod(liborPeriodIndexEnd) - model.getLiborPeriod(liborPeriodIndex);
  
  		if(periodLength3 != periodLength1 && periodLength3 != periodLength2) {
  			rate = model.getLIBOR(exerciseDate, model.getLiborPeriod(liborPeriodIndex), model.getLiborPeriod(liborPeriodIndexEnd));
  			basisFunction = basisFunction.discount(rate, periodLength3);
  			basisFunctions.add(basisFunction);//.div(Math.sqrt(basisFunction.mult(basisFunction).getAverage())));
  
  			basisFunction = basisFunction.discount(rate, periodLength3);
  			//			basisFunctions.add(basisFunction);//.div(Math.sqrt(basisFunction.mult(basisFunction).getAverage())));
  		}
  
  		return basisFunctions.toArray(new RandomVariableInterface[0]);
  	}