public void calcStats(){
		int buyquant = Integer.parseInt(buynumber.getText());
		int sellquant = Integer.parseInt(sellnumber.getText());
		int type_int = type.getSelectedIndex()+1;
		int avail = sector.getQuantity(type_int);

		if (avail+buyquant-sellquant<0){
			sellquant=avail+buyquant;
			final int temp = sellquant; // Weird java passthrough thing
			SwingUtilities.invokeLater(new Runnable(){
				public void run(){
					sellnumber.setText(Integer.toString(temp));
				}
			});
		}
		stats[0][0] = Empous.Gov.getStat("reserve");
		stats[0][1] = Empous.Gov.getStat("woodstock");
		stats[0][2] = Empous.Gov.getStat("oiltank");
		stats[1][0] = sector.getCost("capital", type_int);
		stats[1][1] = sector.getCost("wood", type_int);
		stats[1][2] = sector.getCost("oil", type_int);
		
		sum[0][0]=(stats[1][0]*(buyquant-sellquant));
		sum[0][1]=(stats[1][1]*(buyquant-sellquant));
		sum[0][2]=(stats[1][2]*(buyquant-sellquant));
	}