private double calcOutput(int targetLayer,int position){
		int[] relPos;
		int absPos = this.calcAbsolutePosition(targetLayer, position);
		double[] input = new double[addedNeurons];
		double[] weights = new double[addedNeurons];
		boolean inputNeuron=true;

		for(int row = 0; row < addedNeurons;row++){
			if(weightMatrix[row][absPos] != 0){
				inputNeuron = false;
				relPos = calcRelativePosition(row);
				weights[row] = weightMatrix[row][absPos];				
				input[row] = calcOutput(relPos[0],relPos[1]);
			}else{
				weights[row] = 0;
				input[row] = 0;
			}
		}		

		if (inputNeuron){
			//Input Neurons don't have any edges connect to them and have an output preseted
			//that output is saved in lastOutput.
			return neuronLayer[targetLayer].get(position).getLastOutput();			
		}else{
			//All the other Neurons calculate their output with the calcOutput function.
			return neuronLayer[targetLayer].get(position).calcOutput(input, weights);
		}		
	}