Unit input = m_inputUnits.get(i);
Unit output = m_outputUnits.get(i);
List<UnitBox> input_boxes = input.getUnitBoxes();
List<UnitBox> output_boxes = output.getUnitBoxes();
for(int j = 0; j < input_boxes.size(); ++j){
UnitBox input_box = input_boxes.get(j);
UnitBox output_box = output_boxes.get(j);
Unit input_target = input_box.getUnit();
//using the addIf method makes targets null
if(input_target == null)
continue;
int target_i = findTarget(input_target);
output_box.setUnit(m_outputUnits.get(target_i));
}
}
}