After weeks of delays, a U.S. bankruptcy court judge has approved a plan that will allow Relativity Media to continue accessing a $35 million debtor-in-possession loan.

The film studio behind “Limitless” and “Act of Valor” is trying to hammer out a reorganization plan that will take it out of Chapter 11 protection. Founder Ryan Kavanaugh has cobbled together a group of investors to buy back parts of the company, including its film studio, sports agency business, and stake in a for-profit school.

As part of the Kavanaugh group’s bid, a subsidiary of hedge fund Elliott Associates has taken over the DIP funding from Cortland Capital.

In a statement, a spokesman for Relativity said the company “…remains focused on completing and submitting to the Court its plan of reorganization that will detail its capital structure and strategy for long-term growth with film, digital, music, sports and branded entertainment.”

Attorneys for Kavanaugh have been before U.S. Bankruptcy Court Judge Michael Wiles on two previous occasions looking for approval for the new financing arrangement without success. At one hearing, the judge objected to lateness of a filing, saying that it did not give him enough time to review the documents. At a second hearing last week, there remained too many unresolved issues among Relativity’s web of lenders and creditors for the court to grant the go-ahead.

Bennett Spiegel, an attorney for Relativity, said there was one unresolved issue remaining, but assured the court that it would not materially impact the language of the DIP financing order.

The hearing was a model of brevity, lasting barely ten minutes.

Relativity’s television business has been sold to a group of investors that includes Anchorage Capital, Luxor Capital and Falcon Investment Advisors. They bought the studio in exchange for forgiving $125 million in debts.

Weighed down by too many box office misfires, Relativity filed for bankruptcy protection last summer. It listed liabilities of almost $1.2 billion and assets with a book value of just under $560 million.