OMAHA, Neb. (AP) — The costs associated with Norfolk Southern’s fiery February derailment in Ohio have more than doubled to $803 million as the railroad works to clean up the mess and moves forward with all the related lawsuits.

Norfolk Southern recorded another $416 million charge related to the East Palestine derailment on Thursday as part of its second-quarter earnings after previously announcing a $387 million charge earlier this year. Most of the costs are related to the cleanup of the hazardous chemicals that were released, but $222 million is a combination of legal fees and the $63 million of assistance it has offered to the community.

The derailment near the Ohio-Pennsylvania border prompted a national reckoning on railroad safety after thousands of people had to evacuate when officials decided to blow open several tank cars filled with vinyl chloride because they believed they might explode. The resulting fire sent a towering plume of black smoke over the town three days after the derailment that spilled several other hazardous chemicals when the tank cars carrying them ruptured.

The $803 million cost estimate doesn’t include funds to compensate the East Palestine community for any long-term health effects, drop in home values or drinking water issues because those are still being negotiated, so the total will grow. But Norfolk Southern also expects to eventually recover some of those costs from its insurance and lawsuits against other companies involved in the derailment.

CEO Alan Shaw said he’s “proud of the way our team rose to the challenge” after the derailment, and the railroad will continue to help the community around East Palestine recover while also improving general working conditions on the railroad to address’ employees’ quality of life concerns.

“We are delivering on our commitment to recover service quickly,” Shaw said. “We’re delivering on our commitment to make a safe railroad even safer. We’re delivering on our commitment to address quality of life issues for our hard working craft railroaders. And we continue to deliver on our commitment to make things right for the people of East Palestine and the surrounding communities.”

The additional charges related to the derailment, combined with a 6 percent drop in the number of shipments the railroad delivered, more than halved the Atlanta-based company’s profit to $356 million, or $1.56 per share. That’s down from $819 million, or $3.45 per share, a year ago.

Without the derailment costs, NS says it would have earned $2.95 per share in the quarter, still well below Wall Street expectations. The analysts surveyed by FactSet Research generally expected Norfolk Southern to report earnings per share of $3.11.

Norfolk Southern’s revenue declined to $2.98 billion in the quarter, which also disappointed. Analysts were expecting $3.08 billion revenue. Shaw said that full-year revenue is likely to be down at least 3 percent because of the volume concerns and tough pricing environment with fuel surcharges declining sharply. At the start of the year, the railroad had predicted revenue would be roughly flat this year.

The railroad’s traffic was hurt by the derailment because Norfolk Southern had to operate with only one of its two tracks by East Palestine running on a busy corridor. But consumer demand for imported goods has also weakened, and Norfolk Southern’s main competitor in the east, CSX, has said it was able to pick up some of Norfolk Southern’s business in the wake of the derailment.

Shaw said Norfolk Southern’s service has improved to levels rivaling its 2019 performance before the deep cuts it made during the pandemic once it reopened both rail lines through East Palestine. The railroad has also been hiring aggressively over the past year to give it enough crews and other workers to handle all the freight.

The average speed of Norfolk Southern’s trains reached 21.5 mph this month on average, coming close to the 21.8 mph it recorded before the derailment in January.

Railroad executives expect they’ll be able to regain some of their lost business as service continues to improve. But Edward Jones analyst Jeff Windau said there will continue to be pressure on Norfolk Southern’s profits because of weak intermodal shipments, and the sharp decline in fuel surcharge and equipment storage fees the railroad had been charging.

“There’s definitely some challenges to work through in the near term,” Windau said. And he said there will continue to be a spotlight on Norfolk Southern’s efforts to improve safety in the wake of the Ohio derailment.

Shaw said Norfolk Southern has the capacity to handle more shipments when the economy does recover, but with the mix of weaker and stronger demand across different sectors it’s not clear when that will happen as companies continue to deal with inflation and rising interest rates.

But the railroad’s executives said the supply chain congestion that slowed shipments during the pandemic as they moved from overburdened ports over shorthanded railroads and trucks to reach their final destination is essentially gone. So the path is clear for shipments to increase eventually.