private List<Gate> getPreparedCircuit(List<Gate> gates, int n1, 
			int addedInputs, int startOfP2Output, int m2, int gatesToBeAdded) {
		for (Gate g: gates) {
			int leftIndex = g.getLeftWireIndex();
			int rightIndex = g.getRightWireIndex();
			int outputIndex = g.getOutputWireIndex();

			if (outputIndex >= startOfP2Output) {
				g.setOutputWireIndex(outputIndex + gatesToBeAdded);
			}

			outputIndex = g.getOutputWireIndex();

			if (leftIndex >= n1) {
				g.setLeftWireIndex(leftIndex + addedInputs);
			}
			if (rightIndex >= n1) {
				g.setRightWireIndex(rightIndex + addedInputs);
			}
			if (outputIndex >= n1) {
				g.setOutputWireIndex(outputIndex + addedInputs);
			}
		}
		return gates;
	}