It’s official: A hedge fund helmed by Sears’ controversial ex-CEO has closed the deal to buy the beleaguered company for $5.2 billion.

A federal bankruptcy judge approved the purchase by Eddie Lampert’s ESL Investments last week, giving the green light for the bankrupt retailer, which also owns Kmart, to avoid liquidation and begin a second act.

The new company will be significantly smaller with 223 Sears and 202 Kmart stores. But it will be trying to thrive in the same competitive environment that hobbled it before, leading it to shutter more than 3,500 locations, and slash roughly 250,000 jobs amid tumbling sales.