                              In the

    United States Court of Appeals
                For the Seventh Circuit
No. 17-2389

PEGGY BERG,
                                               Plaintiff-Appellant,

                                v.


SOCIAL SECURITY ADMINISTRATION,
                                              Defendant-Appellee.


      Appeal from the United States Bankruptcy Court for the
                  Western District of Wisconsin.
              Nos. 3:14-BK-13435 & 3-16-00089-cjf —
               Catherine J. Furay, Bankruptcy Judge.



   ARGUED FEBRUARY 7, 2018 — DECIDED AUGUST 17, 2018


   Before BAUER, ROVNER, and SYKES, Circuit Judges.
   ROVNER, Circuit Judge. Shortly before Peggy Berg filed a
petition for bankruptcy, the Social Security Administration
(“SSA” or “Agency”) reduced the payment of a back-award
that it owed to her by the amount of an earlier overpayment
that Berg owed to the Agency. Berg contested this setoff
2                                                    No. 17-2389

because it was taken during the ninety-day period before the
filing of her bankruptcy petition. The bankruptcy court
concluded that SSA permissibly recovered $17,385 of its
overpayment but impermissibly improved its position by
$2,015, and ordered the Agency to return that amount to Berg.
This court granted a petition to file a direct appeal from the
bankruptcy court. We now affirm the judgment of the bank-
ruptcy court.
                                I.
   The facts are undisputed. Berg began receiving Social
Security disability benefits in June 1994. In 2002, she returned
to work. Although she notified the Agency that she was
working again, SSA continued to pay her benefits until
December 2003. The Agency subsequently determined that it
overpaid Berg in the amount of $25,690. An administrative law
judge determined that Berg was without fault in incurring this
overpayment, but that SSA could nevertheless recover the
overpayment under the terms of the Social Security Act. Based
on Berg’s income and ability to pay, the administrative law
judge ordered her to repay $24,000 to the Agency at a rate of
$300 per month. Berg did not appeal that decision and began
making payments.
    Berg stopped working again on November 17, 2012 but
continued to make regular, smaller payments towards her SSA
debt. In March 2014, Berg filed a new application for disability
benefits. Because of Berg’s age and condition, SSA gave
priority consideration to her case and granted her application
on July 15, 2014. The Agency determined that Berg met the
criteria for disability benefits as of November 17, 2012, the date
No. 17-2389                                                    3

that she stopped working. Under the Social Security Act and
the applicable regulations, Berg’s benefits began to accrue in
May 2013, after a five month waiting period, and became
payable at the end of that month.
    By July 2014, Berg had reduced the debt that she owed to
the Agency to $19,400. In a Notice of Award letter (“Notice”)
dated July 30, 2014, the SSA informed Berg that she was
entitled to disability benefits beginning in May 2013, and that
she would receive her first check in August 2014. According to
the Notice, Berg had accrued benefits at a rate of $1,440 per
month from May to November 2013, and at an increased rate
of $1,461 from December 2013 through July 2014, due to a cost-
of-living adjustment. Her accumulated benefits from May 2013
through July 2014 totaled $20,307. The Notice explained that
the SSA would deduct from that total the $19,400 that Berg still
owed from the Agency’s earlier overpayment. In early August
2014, Berg received a check for $907. The SSA subsequently
denied a request from Berg to reconsider the Agency’s decision
to recover its earlier overpayment from her back-award.
    On August 7, 2014, Berg filed a petition for bankruptcy. She
listed the $19,400 that the SSA recovered from her as a setoff in
her Statement of Financial Affairs, and also included that same
amount as a possible asset subject to recovery in her schedules.
11 U.S.C. § 553. She then commenced an adversary proceeding
against the SSA under 11 U.S.C. §§ 553(b) and 522(h), seeking
recovery of the amount of back-benefits set off by the SSA. The
bankruptcy court found that the elements for setoff under the
bankruptcy code were present. Specifically, the SSA had a pre-
petition claim against Berg for return of its earlier overpay-
ment; SSA owed a pre-petition debt to Berg because of the
4                                                     No. 17-2389

award of back-benefits; the obligations were mutual; and both
the claim and the debt were valid and enforceable. 11 U.S.C.
§ 553(a); In re Doctors Hosp. of Hyde Park, Inc., 337 F.3d 951, 955
(7th Cir. 2003) (setoffs are allowed when debts are mutual and
“the general rule is that mutuality is satisfied when the
offsetting obligations are held by the same parties in the same
capacity (that is, as obligor and obligee) and are valid and
enforceable, and (if the issue arises in bankruptcy) both
offsetting obligations arise either prepetition or postpetition,
even if they arose at different times out of different transac-
tions.”).
    The bankruptcy court noted that a trustee, or as was the
case here, a debtor acting under 11 U.S.C. § 522(h), may
recover a setoff under 11 U.S.C. § 553(b)(1), to the extent that
a creditor improved its position within the ninety days
preceding the debtor’s filing of the bankruptcy petition. This
ninety-day preference test allows the trustee or debtor to
recover from the creditor the amount offset to the extent that
the insufficiency on the setoff date is less than the insufficiency
on the later of (a) ninety days before the petition filing date,
and (b) the first date on which there was an insufficiency
during the ninety days immediately preceding the petition
date. “Insufficiency,” the court explained, is the amount by
which a creditor’s claim exceeds the amount of its debt. See
11 U.S.C. § 553(b)(2) (“‘insufficiency’ means amount, if any, by
which a claim against the debtor exceeds a mutual debt owing
to the debtor by the holder of such claim.”). The date ninety
days prior to Berg’s August 7, 2014 filing was May 9, 2014. The
court calculated that Berg’s total accrued disability benefit as
of May 9, 2014 was $17,385. That same day, Berg owed the
No. 17-2389                                                      5

Agency $19,400. That meant that on May 9, 2014, the insuffi-
ciency was $2,015. The court then compared that amount with
the insufficiency on the date that the SSA took the setoff, July
30, 2014. By then, Berg still owed the Agency $19,400, but the
SSA owed her $20,307. That meant that there was no insuffi-
ciency on July 30, 2014 (because the SSA’s debt to Berg was
now larger than the amount that she owed the SSA), and the
SSA had improved its position in the amount of $2,015 during
the ninety-day preference period. The court therefore con-
cluded that the SSA was entitled to keep $17,385 and ordered
the Agency to return $2,015 to Berg. Berg appealed.
                                II.
    Although Berg moved under Federal Rule of Civil Proce-
dure 12(c) for judgment on the pleadings, the parties submitted
a pre-trial statement of stipulated facts and the court relied on
that statement in reaching its judgment. This is akin to judg-
ment under Federal Rule of Civil Procedure 52(a). Marantz v.
Permanente Medical Group, Inc. Long Term Disability Plan, 687
F.3d 320, 327 (7th Cir. 2012) (when parties agree to judgment
based on stipulated facts, in effect, the court is asked to decide
the case as if there had been a bench trial in which the evidence
was the material gathered in discovery, and the standard of
review is governed by Federal Rule of Civil Procedure 52(a));
Arlington LF, LLC v. Arlington Hospitality, Inc., 637 F.3d 706, 717
(7th Cir. 2011) (Federal Rule of Bankruptcy Procedure 7052
makes Federal Rule of Civil Procedure 52 applicable to
adversarial bankruptcy proceedings). We review the district
court’s legal conclusions de novo and any factual inferences that
the court drew from the stipulated facts as well as its applica-
tion of the facts to the law for clear error. Marantz, 687 F.3d at
6                                                    No. 17-2389

327. See also Lardas v. Grcic, 847 F.3d 561, 569 (7th Cir. 2017)
(after a bench trial on an adversary proceeding, we review the
bankruptcy court’s legal determinations de novo and its
findings of fact for clear error).
    On appeal, Berg contends that there were no benefits from
which the SSA could take an offset until the Agency issued the
Notice of Award letter on July 30, 2014. According to Berg,
before that Notice was issued, she had no right to a back-
award and the benefits awarded therefore accrued on the day
that the Notice was issued and the setoff was taken. The
bankruptcy court erred, she contends, by treating the back-
benefits as accruing over time, month by month, rather than as
a lump sum on the date that the Agency made the award, July
30, 2014. Berg also argues that the case law supports her
position, and that public policy also favors treating the date of
the Notice as the date that her benefits accrued. If the benefits
accrued on July 30, 2014, Berg maintains, then the Agency
improved its position by the entire amount of the offset during
the ninety-day preference period and she would be entitled to
recoup $19,400. We conclude that Berg’s interpretation of the
law is incorrect.
    The Social Security Act provides that a person who has
worked long enough, has paid taxes into the system, and is
“under a disability,” “shall be entitled to a disability insurance
benefit (i) for each month beginning with the first month after
his waiting period … in which he becomes so entitled to such
insurance benefits[.]” 42 U.S.C. § 423(a)(1) (emphasis added).
Section 423(c)(2) specifies a five-month waiting period after the
onset of disability before an eligible individual may receive her
first disability payment. Even then, that individual does not
No. 17-2389                                                                  7

become entitled to payment of benefits for a particular month
until she survives through the last day of that month. 42
U.S.C. § 402(a). The benefit for a particular month is paid on
the third day of the month after the benefits accrue. The parties
agree that Berg, who was disabled as of November 17, 2012,
became entitled to receive disability payments as of May 2013,
a payment that would have been made in the ordinary course
on June 3, 2013.
    The Social Security Act also provides that, when a benefits
recipient has been overpaid, “recovery shall be made” by
decreasing the benefit payments to which that person may be
entitled. 42 U.S.C. § 404(a). But recovery from (or adjustments
of payments to) a person who is without fault in incurring the
overpayment may not occur if the “adjustment or recovery
would defeat the purpose of this subchapter or would be
against equity and good conscience.” 42 U.S.C. § 404(b)(1). See
also 20 C.F.R. §§ 404.507–509. At a time when Berg had re-
turned to work, an administrative law judge determined both
that recovery of the overpayment would not defeat the
purpose of the Social Security Act and that recovery was not
against equity and good conscience. The Agency thus was
obligated to recover the overpayment, and Berg did not appeal
that ruling.1
    The bankruptcy court correctly concluded that the transac-
tion at issue here met the elements of a setoff under section 553
of the Bankruptcy Code. Under section 553(a), the overpay-
ment to Berg meant that the Agency had a pre-petition claim


1
    That decision is no longer subject to judicial review. 42 U.S.C. § 405(g).
8                                                       No. 17-2389

against Berg; the SSA’s award of back-benefits resulted in the
Agency owing a pre-petition debt to Berg; the obligations were
mutual; and both the claim and the debt were enforceable.
11 U.S.C. § 553(a); Doctors Hospital, 337 F.3d at 955. “Although
no federal right of setoff is created by the Bankruptcy Code,
11 U.S.C. § 553(a) provides that, with certain exceptions,
whatever right of setoff otherwise exists is preserved in
bankruptcy.” Citizens Bank of Maryland v. Strumpf, 516 U.S. 16,
18 (1995). The right of setoff, the Court explained, allows
entities to apply their mutual debts against each other to avoid
the pointless exercise of “making A pay B when B owes A.”
Citizens Bank, 516 U.S. at 18 (citing Studley v. Boylston Nat’l Bank
of Boston, 229 U.S. 523, 528 (1913)).
   Section 553(b) sets the limits for a creditor’s right of setoff
during the ninety-day period prior to the filing of a bankruptcy
petition:
       (1) Except with respect to a setoff of a kind
       described in section 362(b)(6), 362(b)(7),
       362(b)(17), 362(b)(27), 555, 556, 559, 560, 561,
       365(h), 546(h), or 365(i)(2) of this title, if a credi-
       tor offsets a mutual debt owing to the debtor
       against a claim against the debtor on or within 90
       days before the date of the filing of the petition,
       then the trustee may recover from such creditor
       the amount so offset to the extent that any insuf-
       ficiency on the date of such setoff is less than the
       insufficiency on the later of—
       (A) 90 days before the date of the filing of the
       petition; and
No. 17-2389                                                                    9

         (B) the first date during the 90 days immediately
         preceding the date of the filing of the petition on
         which there is an insufficiency.
         (2) In this subsection, “insufficiency” means
         amount, if any, by which a claim against the
         debtor exceeds a mutual debt owing to the
         debtor by the holder of such claim.
11 U.S.C. § 553(b). In plain English—a commodity rarely found
in the Bankruptcy Code—this means that a debtor like Berg2
may recover from a creditor like the SSA an amount set off by
the creditor in the ninety days preceding the filing of the
bankruptcy petition but only to the extent that the creditor
improved its position during that ninety-day period. That, in
turn, depends on determining the difference between any
insufficiency in the Agency’s position ninety days before the
bankruptcy filing and its position on the date of the setoff.
Insufficiency, as the bankruptcy court noted, is the “amount,
if any, by which a claim against the debtor [Berg] exceeds a
mutual debt owing to the debtor by the holder of such claim
[the SSA].” 11 U.S.C. § 553(b)(2).
    The parties seem to agree in principle on the mathematical
process that courts apply when calculating the insufficiency.
See, e.g., Braniff Airways, Inc. v. Exxon Co., U.S.A., 814 F.2d 1030,


2
  Section 522(h) of the Bankruptcy Code allows the debtor to recover a
setoff that is recoverable by the trustee under section 553 if the trustee does
not herself attempt to recover it. 11 U.S.C. § 522(h). See also Lee v. Schweiker,
739 F.2d 870, 873 n.3 (3d Cir. 1984) (when the trustee does not pursue
exempt assets, the assets are of no benefit to the creditors, and the debtor is
empowered to intervene in the proceeding and pursue those assets).
10                                                              No. 17-2389

1040 (5th Cir. 1987). The dispute comes instead in determining
when SSA began to owe benefits to Berg. Although Berg
characterizes the issue as when the setoff occurred, the real
question is when Berg’s benefits began to accrue after she filed
her second application for disability benefits. Berg asserts that
she had no right to benefits at all until the Agency determined
in July 2014 that she was entitled to benefits and was owed
back-benefits. The back-benefits, Berg contends, accrued on
July 30, 2014 when the SSA issued the Notice awarding the
benefits. In her view, then, the SSA improved its position by
the entire $19,400 that it took in setoff during the ninety-day
preference period. The SSA, on the other hand, contends that,
although it did not issue its Notice until July 2014, Berg was
disabled as of May 2013 and thus began to accrue benefits on
a monthly basis at that earlier date. Under that scenario, the
SSA improved its position by only $2,015 during the preference
period, and that is the amount that should be returned to Berg.3
   In support of her argument that she had no benefits from
which to take an offset until the date of the Notice awarding
those benefits, Berg relies largely on an unpublished decision
from a bankruptcy court in North Carolina. See In re Goodman,
2012 WL 529574 (Bankr. E.D.N.C. Feb. 17, 2012). That court


3
  In a footnote in its brief, the SSA states that, for the purposes of this
appeal, the Agency does not dispute the bankruptcy court’s determination
that Berg is entitled to recover $2,015 of the $19,400 in back-benefits that the
SSA took in offset. In the bankruptcy court, the Agency took the position
that it was entitled to recover the entire $19,400 because there was nothing
the SSA could do in the ninety days pre-petition to improve its position.
The Agency apparently wishes to preserve that argument for future cases
but concedes the $2,015 calculation here.
No. 17-2389                                                   11

assumed without analysis that the date of the award of back-
benefits governed the calculation of the insufficiency, treating
the date of the Agency’s decision to award back-benefits as the
date of accrual for the entire amount. The bankruptcy court
here rejected that case in favor of the reasoning of the Third
Circuit in Lee v. Schweiker, 739 F.2d 870 (3d Cir. 1984).
   In Lee, the debtor was receiving monthly retirement benefits
from the Agency. One year, she engaged in work that should
have reduced her entitlement to benefits but the Agency was
unaware that she had earned this income and continued to pay
her retirement benefits at the higher rate, resulting in an
overpayment of approximately $750. Lee reached an agree-
ment with SSA to repay the overpayment by having the
Agency reduce her monthly benefits by approximately $100
per month until the overpayment was recovered. Lee then filed
for bankruptcy but SSA was not aware of the filing and
continued to deduct $100 per month from Lee’s benefit check.
When the trustee did not seek to recover the amounts de-
ducted, Lee filed an adversary proceeding to recover them
herself.
    The court first concluded that, once a bankruptcy petition
is filed, “the income provided by Social Security benefits
should be protected by the automatic stay,” and that the “right
of SSA to recover pre-petition debts should be subject to the
limitations on setoff.” 739 F.2d at 876. The court was then faced
with calculating the insufficiency on the relevant dates, and
that, in turn, depended on when SSA owed the debtor her
benefits. The debtor asserted that, under the Social Security
Act, a recipient does not become entitled to benefits for a
particular month until she survives through the last day of that
12                                                  No. 17-2389

month, and so the Agency would owe her nothing on August
15 for the month of August. 42 U.S.C. § 402(a). The court held
that section 402(a) of the Social Security Act applied in the
bankruptcy context as well. 739 F.2d at 877. The court then
applied that provision to the debtor’s claim:
       In order to accrue benefits, all the beneficiary
       must do is survive; if the debtor survives, SSA
       must pay. Under these circumstances, we believe
       that all of the monthly benefits that came due
       before the filing of the petition should be consid-
       ered obligations of SSA to the beneficiary ninety
       days before the petition is filed for the purposes
       of applying the “improvement in position” test,
       even though they are not yet payable.
Lee, 739 F.2d at 877. In other words, the court found that the
“SSA would be obligated to Lee for three months benefits …
ninety days before the filing.” 739 F.2d at 877 n.13. Under the
facts in Lee, that meant that there was no insufficiency ninety
days before the filing but an “‘excess’ of debts to the debtor
over claims against the debtor.” Id. Because there had not been
an improvement in the SSA’s position in the ninety days prior
to the filing of the petition, the SSA was not required to return
the amounts recouped before the petition was filed.
   That understanding of Social Security benefits as accruing
as soon as the recipient survives the month and is lawfully
entitled to them is consistent with the Bankruptcy Code’s
concepts of “debt” and “claim” as they are used in section
553(b)(2). We have noted that, although the Bankruptcy Code
does not specify when a debtor incurs a debt, the Code’s
No. 17-2389                                                                13

definitions of “debt” and “claim” aid our understanding. In re
Energy Co-op, Inc., 832 F.2d 997, 1001 (7th Cir. 1087). “The term
‘debt’ means liability on a claim.” 11 U.S.C. § 101(12). The term
“claim” is defined in relevant part as:
        right to payment, whether or not such right is
        reduced to judgment, liquidated, unliquidated,
        fixed, contingent, matured, unmatured, dis-
        puted, undisputed, legal, equitable, secured, or
        unsecured[.]
11 U.S.C. § 101(5)(A). Under the Social Security Act, as the
Third Circuit pointed out in Lee, a beneficiary has a right to
payment of benefits as soon as the beneficiary survives to the
end of the month that the beneficiary is eligible for benefits.4
Under the Bankruptcy Code, it does not matter if that right to
payment is “reduced to judgment, liquidated, unliquidated,
fixed, contingent, matured, unmatured, disputed, undisputed,
legal, equitable, secured, or unsecured.” The claim, and
therefore the debt, accrue as soon as there is a right to benefits,
a date determined in this instance by the Social Security Act
itself.
   When Berg filed an application for disability benefits in
March 2014, she created an unliquidated, contingent claim
against the SSA that related back to the (then undetermined)
date that she became entitled to benefits. That date was later


4
  Lee was receiving retirement benefits under 42 U.S.C. § 401 et seq., and
Berg was receiving disability benefits under 42 U.S.C. § 423(a), but in either
case the recipient must survive to the end of an eligible month to be entitled
to payment of benefits for that month. 42 U.S.C. § 402.
14                                                   No. 17-2389

determined to be May 2013, and neither party disputes that the
SSA accurately calculated the amount of the back-award
(starting on that date) in its Notice. The bankruptcy court thus
correctly calculated the accrual of Berg’s benefits as occurring
on the dates that she had a right to benefits, or the last day of
each month that she was eligible for benefits and survived to
the end of the month. On May 9, 2014, the date that was ninety
days prior to the filing of the petition, that amount was $17,385.
Because Berg then owed the Agency $19,400, the insufficiency
on May 9, 2014 was $2,015. On July 30, 2014, the date the SSA
took the setoff, Berg still owed the Agency $19,400, but the SSA
owed her $20,307. That meant that there was no insufficiency
on July 30, 2014, and the SSA had improved its position in the
amount of $2,015 during the ninety-day preference period.
That is the amount that Berg may now recover.
     There is no basis in policy to conclude otherwise. First,
section 553 does not bar setoffs entirely but simply prevents a
creditor from improving its position during the ninety-day pre-
petition period. This limit on setoffs was imposed in order to
allow the trustee to recover setoffs that improved the position
of one creditor at the expense of all the others during the
ninety-day period prior to bankruptcy. Matter of Prescott, 805
F.2d 719, 730 (7th Cir. 1986). As the Third Circuit explained in
Lee, Congress was concerned that creditors, primarily banks
that had mutual accounts with debtors, would anticipate the
filing of a bankruptcy petition and attempt to secure an
advantage for themselves by decreasing an insufficiency to the
detriment of other creditors. Lee, 739 F.3d at 877. That same
concern does not apply to the Agency’s recovery of overpay-
ments because neither the debtor nor the SSA can do anything
No. 17-2389                                                 15

to increase the amount of benefits that will accrue during the
ninety-day pre-petition period. Essentially, neither party can
manipulate the process to the detriment of other creditors.
Recognizing the creation of SSA’s contingent debt to Berg on
the date when Berg became entitled to disability benefits (and
accruing it monthly thereafter) rather than using the arbitrary
date that the Agency issued its administrative decision is
consistent with both the Social Security Act and the Bank-
ruptcy Code.
                                                  AFFIRMED.
