@SuppressWarnings("unchecked")
	private void removeBlankWires(List<Gate> gates){

		// false means blank
		boolean[] blankWires = circuitParser.getBlankWires();
		int numberOfWires = circuitParser.getNumberOfWires();

		// Runs from top to bottom, decrementing the appropriate wires
		// Is a bit funky since we cannot guarantee the input circuit
		// is sorted by output wires
		for(int i =  numberOfWires - 1; i >= 0; i--){
			boolean b = blankWires[i];
			if(!b){
				for(int j = i; j < numberOfWires; j++){
					Gate outputG = outputMap.get(j);
					if (outputG != null){
						outputG.setOutputWireIndex(outputG.getOutputWireIndex() - 1);
					}

					Collection<Gate> leftWires = leftMap.getCollection(j);
					if (leftWires != null){
						for(Gate leftG: leftWires){
							leftG.setLeftWireIndex(leftG.getLeftWireIndex() - 1);
						}
					}

					Collection<Gate> rightWires = rightMap.getCollection(j);
					if (rightWires != null){
						for(Gate rightG: rightWires){
							rightG.setRightWireIndex(rightG.getRightWireIndex() - 1);
						}
					}
				}

				/*
				 * Should be used if the circuit is sorted by output gate
				 */
//				java.util.ListIterator<Gate> iterator = 
//						gates.listIterator(gates.size());
//
//				while(iterator.hasPrevious()) {
//					Gate g = iterator.previous();
//					int leftIndex = g.getLeftWireIndex();
//					int rightIndex = g.getRightWireIndex();
//					int outputIndex = g.getOutputWireIndex();
//
//					if(leftIndex > i){
//						g.setLeftWireIndex(leftIndex - 1);
//					}
//					if(rightIndex > i){
//						g.setRightWireIndex(rightIndex - 1);
//					}
//					if(outputIndex > i){
//						g.setOutputWireIndex(outputIndex - 1);
//					}
//				}
			}
		}
	}