private static int add(boolean b, ChemistryUnit inX, ArrayList<ChemistryUnit> uniqueUnitTypes, int[][] originalMatrix, int counterInitialValue){
		int originalMatrixCounter = counterInitialValue;
		for(Map.Entry<ChemistryUnit, Integer> map : inX.getUnitEntrySet()){
			for(Map.Entry<ChemistryUnit, Integer> entry : map.getKey().getUnitEntrySet()){
				int index = 0;
				for(int i = 0; i<uniqueUnitTypes.size();i++){
					if(uniqueUnitTypes.get(i).equals(entry.getKey())){
						index = i;
					}
				}
				originalMatrix[index][originalMatrixCounter] = originalMatrixCounter != 0 && b ? -entry.getValue() : entry.getValue();
			}

			originalMatrixCounter++;
		}
		return originalMatrixCounter;
	}