private double trainOnInstance(BackpropInstance instance){
		NeuralLayerI inputLayer = _layers[0];
		for(int i = 0; i < instance._features.length; i++){
			inputLayer.getNodes()[i].setOutput(instance._features[i]);
		}
		
		for(int i = 1; i < _layers.length ; i++){
			NeuralLayerI curLayer = _layers[i];
			NeuralNode[] curNodes = curLayer.getNodes();
			
			NeuralLayerI prevLayer = _layers[i - 1];
			NeuralNode[] prevNodes = prevLayer.getNodes();
			
			if(curLayer._isOutputLayer){
				for (int j = 0; j < curNodes.length; j++) {
					double net = 0;
					for (int k = 0; k < prevNodes.length; k++) {
						net += prevNodes[k].getOutput()
								* prevNodes[k].getWeightTo(curNodes[j]);
					}
					curNodes[j].setNet(net);
					curNodes[j]
							.setOutput(((double) 1.0) / (1 + Math.exp(-net)));
				}
			} else {
				for (int j = 0; j < curNodes.length - 1; j++) {
					double net = 0;
					for (int k = 0; k < prevNodes.length; k++) {
						net += prevNodes[k].getOutput()
								* prevNodes[k].getWeightTo(curNodes[j]);
					}
					curNodes[j].setNet(net);
					curNodes[j]
							.setOutput(((double) 1.0) / (1 + Math.exp(-net)));
				}
			}
		}
		
		double highest = -1.1;
		double toReturn = -1.0;
		NeuralNode[] outputNodes = _layers[_layers.length - 1].getNodes();
		for(int i = 0; i < outputNodes.length ; i ++){
			if(outputNodes[i].getOutput() > highest){
				highest = outputNodes[i].getOutput();
				toReturn = (double)i;
			}
		}
//		System.out.println(toReturn);
		return toReturn;
	}