
    AVENTINE RENEWABLE ENERGY, INC., Plaintiff-Appellant, v. GLACIAL LAKES ENERGY, LLC, and Aberdeen Energy, LLC, Defendants-Appellees.
    Nos. 16-1690, -1692
    United States Court of Appeals, Seventh Circuit.
    Argued November 8, 2016
    Decided December 14, 2016
    Jeffrey P. Justman, Aaron D. Van Oort, David R. Merritt, Attorneys, FAEGRE BAKER DANIELS LLP, Minneapolis, MN, Michael D. Gifford, Thomas W. O’Neal, Attorney, HOWARD & HOWARD ATTORNEYS PLLC, Peoria, IL, for Plaintiff-Appellant.
    David G. Lubben, Attorney, DAVIS & CAMPBELL L.L.C., Peoria, ’ IL, Eric John Nystrom, Karla Marie Vehrs, Michael Lavern Weaver, Attorneys, LIND-QUIST & VENNUM, Minneapolis, MN, for Defendant-Appellee.
    Before WOOD, Chief Judge, and POSNER and ROVNER, Circuit Judges.
   POSNER, Circuit Judge.

The plaintiff, Aventine, is a distributor of ethanol, a common additive to gasoline. The two defendants, affiliated. companies that for the sake of simplicity we’ll pretend are one and call Glacial, manufacture and sell ethanol. The disputants are of diverse citizenship, and have agreed that the law applicable to their dispute is that of New Yoi’k State.

Until 2009, Aventine bought ethanol from Glacial and distributed it, but in January of that year the parties executed “termination agreements.” The ágree-ments required Aventine to pay Glacial $898,000 (we round to the nearest $1000) for ethanol that Aventine had received from Glacial before the termination date specified in the agreements but had not yet paid for (the parties call the payments that Aventine was required to make “true-up payments”) and required Glacial to pay Aventine $1,250,000 for commissions that Glacial would have had to pay Aventine for marketing the ethanol that Aventine had agreed to buy from it. In addition Glacial agreed to assume Aventine’s leases from Union Tank Car Company of 473 railcars used for transporting ethanol; trembling on the brim of bankruptcy, Aventine didn’t need railcars any more.

Glacial used the railcars between February 23 and April 7 (Aventine declared bankruptcy on April 7) without reimbursing Aventine for the lease payments that Aventine owed Union Tank, a sum exceeding $500,000, which Aventine could not afford to pay. When Aventine declared bankruptcy, Glacial owed it some $1,600,000 for marketing commissions and railcar leases while Aventine owed Glacial some $900,000 for the ethanol it had bought from Glacial before the termination date specified in the termination agreements. Netting the two debts would have resulted in Glacial’s paying Aventine $700,000. But because, or at least ostensibly because, Aventine either couldn’t or wouldn’t pay Glacial any part of the $900,000 that Aventine owed it, Glacial refused to pay Aventine the $700,000 — or indeed anything, while continuing to use the railcars Aventine had transferred to it.

Further bypassing Aventine, Glacial made a deal to lease the railcars from Union Tank. Although the termination agreements required Glacial if it wanted to use the railcars to secure a release of Aventine from its Union Tank leases, Glacial didn’t do that and as a result Aventine was required- as part of its bankruptcy plan to make good on what it owed to Union Tank — to the tune of almost $2.3 million worth of Aventine stock.

Why wasn’t the dispute resolved in the bankruptcy proceeding? Glacial wouldn’t have fried a claim in bankruptcy court, because a claim is a right to payment, 11 U.S.C. § 101(5)(A), and Glacial was a net loser under the termination agreements. Had if filed a claim Aventine would have responded with defenses and a counterclaim. See 28 U.S.C. § 157(b)(2)(C), (c)(1); Stern v. Marshall, 564 U.S. 462, 131 S.Ct. 2594, 180 L.Ed.2d 475 (2011). Aventine could have initiated an adversarial proceeding but didn’t need to, since its bankruptcy plan explicitly preserved its cause of action, along with Glacial’s right of set-off.

Still owed lots of money by Glacial, after going through bankruptcy Aventine sued it in an Illinois state court (Aventine is a citizen of Illinois). Glacial removed the suit to federal district court, which granted summary judgment for Glacial on the ground that, while it would be “unjust” to allow Glacial “to avoid any liability” to Aventine, the latter’s failure to make the true-up payments “dooms the Plaintiff!,] as performance is an essential element of its claim for breach of contract.” But to place all the onus on Glacial as the district judge did was mistaken, as both parties had defaulted’ on the obligations they’d agreed to in the termination agreements. Aventine had just happened to sue first — unsurprisingly since it was owed more by Glacial than it owed Glacial..

The district judge ignored the law of New York (which as we said the parties agree governs their dispute), under which a party cannot “at the same time treat the contract as broken and as subsisting,” Strasbourger v. Leerburger, 233 N.Y. 55, 134 N.E. 834, 835 (1922), which is what Glacial did by using the railcars while insisting that Aventine cannot sue for breach of contract. Applying New York law the Second Circuit has held that a party’s “refusal to perform its end of the bargain” after it has affirmed a contract by continu ing to accept its benefits is “impermissible.” ARP Films, Inc. v. Marvel Entertainment Group, Inc., 952 F.2d 643, 649 (2d Cir. 1991); see also McDonald’s Corp. v. Robert A. Makin, Inc., 653 F.Supp. 401, 403 (W.D.N.Y. 1986). Or as the great Judge Cardozo put it, a sales contract kept alive “remains alive as much for the benefit of the buyer as for the benefit of the seller. ... The buyer may now insist that the seller’s misconduct shall be cast in the balance with its own.... If the defendant never retracted its unlawful claim of right, the like is true of the plaintiff. The one as much as the other is chargeable with wrong,” Rubber Trading Co. v. Manhattan Rubber Mfg. Co., 221 N.Y. 120, 116 N.E. 789, 790 (1917).

Glacial argued in the district court that Aventine would suffer no loss from failing to obtain any damages from Glacial because as a result of its bankruptcy the creditors of Aventine are now its owners; they’ll take the loss, since if a corporation sustains a substantial loss, the owners’ stock is worth less. But it doesn’t follow that because the owners of the corporation are hurt, the corporation isn’t. And finally Glacial argues that the value of Aventine’s indemnification claim is zero, because Aventine’s debt to Union Tank (which Glacial promised to cover) was discharged in the bankruptcy in exchange for stock that Aventine would otherwise have been forced to ■ give to another creditor. But Aventine’s debt to Union Tank, and therefore Glacial’s liability to Aventine, was sharply reduced by the bankruptcy. That was enough of a windfall for Glacial. It’s not entitled to more.

The judgment of the district court is reversed, and the case remanded with instructions to net out the difference in the amounts of money owed by the parties to each other and award the difference to the party to whom it is due.  