Better market conditions combined with significant cost control resulted in a 40% adjusted EBITDA increase.
In addition, we generated $73 million of year-to-date free cash flow, bringing our leverage ratio back to pre-pandemic levels.
Our Board authorized a $50 million share repurchase program.
Starting with the liquid-cooled business, it's averaged about $300 million in revenues over the last several years.
This business represents approximately $100 million of revenue and it's currently running at a lower rate due to the global pandemic.
CIS sales were down 14% from the prior year, primarily due to COVID-related declines in our commercial HVAC and refrigeration markets along with lower data center sales.
Adjusted EBITDA was down 7% on lower sales.
But I'm pleased to report the margin improved 70 basis points despite lower revenue.
In fact, if we adjust for the negative effect of lower data center sales, the margin would have improved by approximately 300 basis points versus the prior year and lower sales.
The Building HVAC segment had another great quarter with sales up 11% from the prior year.
We'll finish the fiscal year up more than 50%.
I want to highlight that adjusted EBITDA increased 42% from the prior year, primarily due to higher sales volume and favorable product mix.
This resulted in a 500 basis point improvement in EBITDA.
Sales in the HDE or heavy duty equipment were down 12% from the prior year but a significant improvement from Q1 as markets continue to stabilize.
Adjusted EBITDA was up 42% on a 460 basis point margin improvement despite lower sales.
Sales were down 5% from the prior year, which also represents a large sequential improvement from the first quarter.
Adjusted EBITDA improved significantly, up $5.7 million from the prior year, primarily due to cost reductions and other temporary COVID-related savings actions.
Second-quarter sales declined by $39 million or 8% compared to the prior year, driven mostly by the global pandemic and associated economic conditions.
I'm very pleased to report our gross profit was $81 million, which was higher than the prior year by $5 million on lower sales.
And the gross margin increased by 240 basis points to 17.5%.
SG&A was $17 million or 25% lower than the prior year.
Adjusted EBITDA of $55 million was better than the prior year by $16 million or 40%.
Our second quarter adjustments totaled $7.6 million including $5.5 million from CEO transition costs, mostly related to severance and benefit-related expenses owed to the previous CEO.
We also incurred $1.5 million of restructuring expenses related to plant consolidation activities.
And our adjusted earnings per share was $0.43, higher than the prior year by over 200%.
I'm pleased to report our free cash flow for the first six months of fiscal '21 was $73 million, which represents a $97 million improvement over the prior year.
And I'm very pleased to report that our resulting leverage ratio was 2.2, back to pre-pandemic levels and within our target range.
We expect slightly positive cash flow for the remainder of the year, resulting in full year free cash flow of $70 to $80 million.
For example, we have approximately $20 million in pension contributions along with the phase-out of payroll tax deferral under the care of that.
We also expect higher capital spending in the second half of the fiscal year along with some working capital growth in-line with the recovery.
We expect our net sales to be down between 7% and 12% from the prior year.
And for adjusted EBITDA to be in a range of $155 to $165 million.

Summary:
Second-quarter sales declined by $39 million or 8% compared to the prior year, driven mostly by the global pandemic and associated economic conditions.
And our adjusted earnings per share was $0.43, higher than the prior year by over 200%.
We also expect higher capital spending in the second half of the fiscal year along with some working capital growth in-line with the recovery.
We expect our net sales to be down between 7% and 12% from the prior year.
And for adjusted EBITDA to be in a range of $155 to $165 million.