public double augmentFrontEndCharges(double capacity, int reactor_type, int year_count, PrintWriter output_writer) {        // front end cost calculation

		int i;
		double charge=0;
		double pvf;

		if (year_count > FRONTENDREFYEAR[0] - START_YEAR) {         // if past the reference date, total NU use must be calculated
			TotalFrontEndUse[0][year_count] = TotalFrontEndUse[0][year_count-1];      // the value of the previous year is taken
			for (int j = 0; j < REACTORNAMES.length; j++) {                                 //and all reactor use in current year is added to that
				TotalFrontEndUse[0][year_count] += NatUraniumUse[j][year_count];
			}
		} else {                                                // else total NU usage is just the reference amount
			TotalFrontEndUse[0][year_count] = FRONTENDREFAMOUNT[0];
		}
		
		for(i = 0; i < FRONTENDTECH.length; i++) {
			pvf = Math.exp(TIMELAG_FRONTEND[i]*DiscountRate);
			
			if (year_count > FRONTENDREFYEAR[i] - START_YEAR) {
				double timeprice = Math.pow(year_count + START_YEAR - FRONTENDREFYEAR[i], FRONTENDTIMEEXP[i]);        //price increase due to time
				double amountprice = Math.pow(TotalFrontEndUse[i][year_count] / FRONTENDREFAMOUNT[i], FRONTENDAMOUNTEXP[i]);    //price increase due to comsumption
				FrontEndPriceModifier[i][year_count] = timeprice * amountprice;      //total price increase
			}
			charge += getFECharge(reactor_type, i, capacity, year_count) * pvf * FrontEndPriceModifier[i][year_count];
			if(add_to_integrals) integratedCosts[reactor_type][1+i] += getFECharge(reactor_type, i, capacity, year_count) * pvf * socialPVF;
			if(print_cost_coefficients) if(printOutputFiles) output_writer.print((getFECharge(reactor_type, i, capacity, year_count) * pvf) + " ");

		}
		
		return(charge);
	
	}