Add structure calculating code.