insertCalculations() and insertHeadingData() updated with new parameters