739 F.2d 870
11 Collier Bankr.Cas.2d 834, Bankr. L. Rep.  P 69,914,6 Soc.Sec.Rep.Ser. 98,Unempl.Ins.Rep. CCH  16,982Lillie LEE, Appellant,v.Richard S. SCHWEIKER, Secretary of Health and HumanServices, Appellee.
No. 83-1564.
United States Court of Appeals,Third Circuit.
Argued March 7, 1984.Decided June 29, 1984.

Irv Ackelsberg (argued), Community Legal Services, Inc., Philadelphia, Pa., for appellant.
Edward S.G. Dennis, Jr., U.S. Atty., Walter S. Batty, Jr., Asst. U.S. Atty., Chief of Appeals, Virginia R. Powel (argued), Asst. U.S. Atty., Philadelphia, Pa., Randolph W. Gaines, Deputy Asst. General Counsel for Litigation, John B. Watson, Chief of Assistance Payments Litigation, Robin F. Kaplan, Atty., Office of the General Counsel, Social Security Division, Dept. of Health and Human Services, Baltimore, Md., for appellee.
Before HUNTER and BECKER, Circuit Judges, and HOFFMAN, District Judge.*
OPINION OF THE COURT
BECKER, Circuit Judge.


1
This appeal presents two technical issues of bankruptcy law.  The first involves the extent to which the doctrine of recoupment allows the Social Security Administration ("SSA") to continue recovering a pre-bankruptcy overpayment from the benefit checks of a debtor after she has filed a Chapter 13 petition, in spite of the automatic stay created by 11 U.S.C. Sec. 362.  The second involves the application of the limitation on setoffs contained in 11 U.S.C. Sec. 553(b), known as the "improvement in position test," to the situation in which the SSA agrees to recover an overpayment by means of monthly deductions from a beneficiary's benefit checks, rather than by means of legal process.  We are also confronted with the question whether section 207 of the Social Security Act, 42 U.S.C. Sec. 407, renders SSA immune from the limitations placed on creditors by the Bankruptcy Code.


2
Appellant Lillie Lee is a recipient of old age benefits under the Social Security Act.  In 1980, Lee received overpayments from the SSA amounting to $746.50.  When the overpayments were discovered, SSA made arrangements to recover the amounts overpaid from Lee by deducting part of her monthly benefits over a period of eight months.  Less than three months later, Lee filed a bankruptcy petition.  SSA, unaware of the filing, continued to make the deductions from Lee's monthly benefits until the entire overpayment had been recovered.  Lee then brought this proceeding to recover the amounts of the overpayment, asserting that the continued withholding of part of her benefits after the filing of the bankruptcy petition violated the automatic stay created by 11 U.S.C. Sec. 362, and that the amounts withheld before the filing of the petition were a setoff that improved the position of SSA within ninety days of the bankruptcy filing, and thus were barred by the limitation on setoffs contained in 11 U.S.C. Sec. 553.


3
We reject the contention that Sec. 207 deprives the bankruptcy court of subject matter jurisdiction over the SSA.1   We agree with appellant that the continued deduction of part of her monthly benefits after the filing of her bankruptcy petition violated the automatic stay, and that she thus may recover the amounts withheld after the date of filing.  We disagree, however, that the withholding of part of her checks in the ninety days before the petition violated the "improvement in position" test of section 553, and thus Lee may not recover that portion of the overpayments which SSA withheld before the petition was filed.

I.

4
The debtor, Lillie Lee, is receiving monthly retirement benefits of $406.20 under Title II of the Social Security Act, 42 U.S.C. Sec. 401 et seq.    In 1980, Lee had earned income that reduced her entitlement to benefits.  That income was not reported to SSA and as a result there was an overpayment of benefits totalling $746.50.  When the overpayment was discovered, Lee requested that SSA recover it by reducing her benefits by approximately twenty-five percent, or $102 per month, until the overpayment was recovered.  Beginning with her check dated September 3, 1981, Lee received the reduced payments.2


5
On November 13, 1981, Lee filed a petition under Chapter 13 of the Bankruptcy Code.  Under the Code, the amounts deducted from Lee's social security benefits would be "exempt" from the claims of her creditors if she were entitled to recover them from SSA.  11 U.S.C. Sec. 522(d)(10).  The bankruptcy trustee therefore did not make an effort to recover the amounts deducted.  Lee, however, properly instituted an adversary proceeding pursuant to section 522(h) to recover the deductions for herself.3   She asserted that the deductions made prior to the filing of the petition were recoverable under either 11 U.S.C. Sec. 547 or 11 U.S.C. Sec. 553,4 and that the post-petition deductions were a violation of the automatic stay provided for in 11 U.S.C. Sec. 362.


6
The bankruptcy court held that SSA could keep all the sums it had deducted from Lee's benefit checks both before and after the petition was filed.  25 B.R. 135.  The basis for this holding was that, as the holder of a statutory setoff right, 42 U.S.C. Sec. 404(a)(1), SSA was entitled to be treated as a secured creditor under 11 U.S.C. Sec. 506(a).  The court held that the debtor therefore could not recover the amounts SSA had deducted without providing SSA with adequate protection, 11 U.S.C. Sec. 362, that the burden of showing adequate protection was on the debtor, and that no evidence of adequate protection had been provided.


7
In addition to the primary contentions raised on this appeal, SSA raised a number of other defenses to Lee's recovery of the amounts deducted from her monthly benefits.  The bankruptcy court rejected a defense based on sovereign immunity, citing 11 U.S.C. Sec. 106.  This ruling was clearly correct.   See In re Neavear, 674 F.2d 1201, 1203-04 (7th Cir.1982).  The court also rejected the contention that section 207 of the Social Security Act, 42 U.S.C. Sec. 407, deprives the bankruptcy court of subject matter jurisdiction over the SSA.  We deal with this contention in Part II, infra.    SSA also argued that the overpayments would not be dischargeable in a bankruptcy proceeding and thus that Lee's Chapter 13 plan could not be confirmed.  The bankruptcy court did not render a decision on this point, and SSA does not raise it on this appeal.  The Seventh Circuit rejected this contention in Neavear 67 F.2d at 1206, and we find its disposition of the question persuasive.   See also Gutierrez v. Schweiker, 15 B.R. 268 (N.D.Ill.1981);  Rowan v. Morgan, 15 B.R. 834 (Bankr.N.D.Ohio 1981).  After disposing of SSA's other contentions, the bankruptcy court accepted the SSA's defense that as the holder of a statutory right to setoff SSA was in effect a secured creditor, and thus that Lee could not recover the amounts withheld without providing SSA with adequate protection.


8
The district court affirmed the judgment of the bankruptcy court but did not address the grounds relied on by the bankruptcy court.  Rather the district court held that the SSA's right to recover the overpayment was a right to "recoupment," and that therefore the debtor was thus not entitled to the amounts withheld from her monthly benefit checks.  Under this approach, the amounts withheld from Lee's benefit checks were not "property of the estate," and thus were not subject to either the automatic stay created by Sec. 362 or the "improvement in position" test of Sec. 553.  The debtor appeals.

II.

9
SSA argues that it is exempt from the bankruptcy laws under section 207 of the Social Security Act, 42 U.S.C. Sec. 407, SSA has raised this argument before several courts, all of which have rejected it.   See In re Neavear, 674 F.2d 1201 (7th Cir.1982);  In re Rowan, 15 B.R. 834 (Bankr.N.D.Ohio 1981).  Nonetheless the SSA has raised the argument again before us, and we join these other courts in rejecting it.

Section 207 states:

10
(a) The right of any person to any future payment under this subchapter shall not be transferable or assignable, at law or in equity, and none of the moneys paid or payable or rights existing under this subchapter shall be subject to execution, levy, attachment, garnishment, or other legal process, or to the operation of any bankruptcy or insolvency law.


11
SSA relies on the language "none of the ... rights existing under this subchapter shall be subject to ... the operation of any bankruptcy ... law," to assert that it is protected from any modification of the obligations of recipients to repay previous overpayments.  The courts have held, however that the purpose of this section is to protect recipients from losing benefits to creditors, not to protect the federal fisc from the bankruptcy of recipients.   See In re Greene, 27 B.R. 462 (Bankr.E.D.Va.1983).  We too believe that the language relied on by SSA, when taken in context, does not evince any intent to protect SSA, but rather an intent to protect the recipients of benefits from creditors who might seek to obtain rights to their benefits, by means of either contract or legal process.  It would be inconsistent with the clear intent of the statute to twist its language to hold that a beneficiary could not take advantage of a bankruptcy discharge, the purpose of which is to free future income from prior claims.  We hold, therefore, that section 207 does not provide SSA with the blanket protection it asserts, but instead has no effect on its rights and liabilities when a beneficiary asserts her rights under the Bankruptcy Code as a protection against SSA collection efforts.

III.

12
Lee relies on the automatic stay in asserting her right to recover the amounts withheld from her benefit checks after the filing of her petition.  11 U.S.C. Sec. 362.  The district court rejected this argument, stating that since Lee's debt to SSA arose out of the same "transaction" as SSA's debt to Lee, SSA had a right of "recoupment" that was not subject to either the automatic stay or the limitations on setoff found in section 553 of the Bankruptcy Code, 11 U.S.C. Sec. 553.  Lee responds that the district court mischaracterized the rights of SSA here as "recoupment," arguing that SSA's right to recover for the past overpayment was independent of Lee's right to benefits.


13
An analysis of this issue requires an explication of the relevant doctrines.  The doctrines of "setoff" and "recoupment" had their origins in the era of common law pleading, under which the scope of a "case" was far less inclusive than it is today, and under which claim joinder was far narrower.  Both doctrines permitted countervailing claims, which otherwise could not have been asserted together, to be raised in a case based on any one of them.5   Both doctrines were subsequently adopted in bankruptcy, setoff by statute, see 11 U.S.C. Sec. 108 (1976), repealed by Bankruptcy Reform Act of 1978, Pub.L. No. 95-895, 92 Stat. 2549 (1978);6  and recoupment by decision, see In re Monongahela Rye Liquors, 141 F.2d 864 (3d Cir.1944).  In bankruptcy, however, setoff and recoupment play a role very different from their original role as rules of pleading.  Setoff, in effect, elevates an unsecured claim to secured status, to the extent that the debtor has a mutual, pre-petition claim against the creditor.  See 11 U.S.C. Sec. 506(a).  Setoff is limited, however, by the provisions of 11 U.S.C. Sec. 553.  Among those limitations is that pre-petition claims against the debtor cannot be setoff against post-petition debts to the debtor.7   Recoupment, on the other hand, allows the creditor to assert that certain mutual claims extinguish one another in bankruptcy, in spite of the fact that they could not be "setoff" under 11 U.S.C. Sec. 553.  The justification for the recoupment doctrine is that where the creditor's claim against the debtor arises from the same transaction as the debtor's claim, it is essentially a defense to the debtor's claim against the creditor rather than a mutual obligation, and application of the limitations on setoff in bankruptcy would be inequitable.   See In re Monongahela Rye Liquors, 141 F.2d at 869.


14
The district court held that these debts arose out of the same transaction--"Social Security benefits due to Lillie Lee."    The fact that the same two parties are involved, and that a similar subject matter gave rise to both claims, however, does not mean that the two arose from the "same transaction."    In bankruptcy, the recoupment doctrine has been applied primarily where the creditor's claim against the debtor and the debtor's claim against the creditor arise out of the same contract.   See In re Sherman, 627 F.2d 594 (2d Cir.1980);  Waldshcmidt v. CBS, Inc., 14 B.R. 309 (M.D.Tenn.1981).  In a number of cases involving the bankruptcy of health-care providers, the courts have allowed insurers to "recoup" overpayments from amounts owed to the debtor post-petition, under a contract providing for such recoupment.   See In re Monsour Medical Center, 11 B.R. 1014 (W.D.Pa.1981), aff'g, 8 B.R. 606 (Bankr.W.D.Pa.1981);  In re Yonkers Hamilton Sanitarium, 22 B.R. 427 (Bankr.S.D.N.Y.1982);  In re Berger, 16 B.R. 236 (Bankr.S.D.Fla.1981).   But cf. In re Dartmouth House Nursing Home, 24 B.R. 256 (Bankr.D.Mass.1982), app. dismissed, 30 B.R. 56 (Bankr.App. 1st Cir.1983) (appeal dismissed on jurisdictional grounds).  These contracts provided for advance payment to providers based on estimates of the amount which would ultimately be owed, subject to later correction.  The analysis used in these cases is based on the treatment of executory contracts in bankruptcy:  a debtor may not assume the favorable aspects of a contract (post-petition payments) and reject the unfavorable aspects of the same contract (the obligation to repay pre-petition overpayments by means of "recoupment").


15
The courts have generally taken a different approach in dealing with government benefits to individuals, such as social security.8   In these circumstances, the courts have held that a social-welfare statute entitling an individual to benefits is not a contract, and that the obligation to repay a previous overpayment is a separate debt subject to the ordinary rules of bankruptcy.   E.g. In re Neavear, 674 F.2d 1201 (7th Cir.1982);  In re Hawley, 23 B.R. 236 (Bankr.E.D.Mich.1982);  In re Rowan, 15 B.R. 834 (Bankr.N.D.Ohio 1981);  In re Howell, 4 B.R. 102 (Bankr.M.D.Tenn.1980) (all dealing with the question whether the obligation to repay prior overpayments is a debt dischargeable in bankruptcy).9   We find the distinction persuasive.  Social welfare payments, such as social security, are statutory "entitlements" rather than contractual rights.  The purpose of these payments is to provide income to qualifying individuals.  Although the paying agency can ordinarily recover overpayments, just as creditors can ordinarily obtain payment from a debtor's future income, the Bankruptcy Code protects a debtor's future income from such claims once a petition has been filed, and the SSA violated the automatic stay in continuing to withhold part of Lee's benefits after she had filed her petition.10


16
We conclude that, in spite of statutory or contractual provisions providing for "recoupment" of previous overpayments, the primary purpose of these statutes is to provide income security to the recipients.  Once a bankruptcy petition is filed, the income provided by Social Security benefits should be protected by the automatic stay.  The right of SSA to recover pre-petition debts should be subject to the limitations on setoff, just as it is limited by the provisions for exemption and discharge, In re Neavear, 674 F.2d 1201 (7th Cir.1982), rather than treated as part of a "contract" between the government and the debtor.  Accordingly, we hold that SSA may not recoup previous overpayments from benefits payable after a bankruptcy petition is filed.

IV.

17
Lee asserts that SSA must also turn over the deductions made before the bankruptcy petition was filed, under the rule prohibiting setoffs to the extent that the creditor "improved its position" in the ninety days preceeding the filing of the petition.  Section 553(b) of the Bankruptcy Code, 11 U.S.C. Sec. 553(b), provides that, if the amount by which a creditor's claim against the debtor exceeds the debt owed the creditor by the debtor, known as the "insufficiency," decreases within ninety days of filing the petition, the creditor can only setoff an amount which will leave the "insufficiency" where it was 90 days before the petition was filed.11


18
According to Lee, on the ninetieth day before the petition was filed, she owed SSA the amount of the overpayment, $746.50, and SSA owed her nothing.  Thus, the insufficiency was $746.50.  On the last day of August, solely because she had not died in the interim, SSA owed her one month's benefits, $406.20.  SSA withheld $102 against the prior overpayment, and did the same for the next two months.  After three months, the insufficiency had been reduced by $306, to $440.50.  This allegedly "improved" SSA's position by $306.


19
The keystone of Lee's argument on this point is the assertion that SSA owed nothing to her on August 15, 1981.  Under the Social Security Act, this is correct, because a recipient does not become entitled to the benefits for that month until she survives through the last day of the month.  42 U.S.C. Sec. 402(a).  If this definition is to be used in the bankruptcy context as well, the debtor's argument is correct.


20
The concern of Congress in enacting the improvement in position test was that creditors, primarily banks, that had mutual accounts with the debtor would foresee the approach of bankruptcy and scramble to secure a better position for themselves by decreasing the "insufficiency," to the detriment of the other creditors.  Such a circumstance would not be improbable if banks were allowed to take advantage of any improvement in their position in the ninety days before bankruptcy.12   A bank with a continuing relationship with the debtor could not only anticipate the bankruptcy filing, but also pressure the debtor to increase its deposits, or reduce its short-term loans to the debtor.


21
This concern is not relevant, however, to the SSA's "recoupment" of overpayments.  Neither SSA nor the debtor can do anything to increase the amount of benefits that will accrue in the ninety days before the petition.  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 considered 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.  If all of these benefits are considered, there has not been an improvement in position.13   Accordingly, we hold that SSA does not have to return the amounts recouped before the petition was filed.14V.


22
We conclude that SSA was not entitled to recoup the prior overpayments from benefits owed to the debtor after the petition was filed, but was entitled to recoup from the benefits owed before the petition was filed.  Accordingly, we reverse the judgment as to the $440.50 recouped from post-petition benefits, affirm as to the $306.00 recouped from pre-petition benefits, and remand the case for further proceedings.



*
 The Honorable Walter E. Hoffman, United States District Judge for the Eastern District of Virginia, sitting by designation


1
 SSA argues that is interpretation of Sec. 207 would deprive the bankruptcy court of "subject matter jurisdiction."    Although we believe that, conceptually, SSA's argument could more accurately be described as an "immunity" argument, our disposition of the argument renders it unnecessary to recharacterize it


2
 The $102 was withheld from each check between September 1981 and March 1982, and a final installment of $32.50 was withheld from Lee's April 1982 check


3
 The trustee in a bankruptcy proceeding acts as a representative of the creditors in pursuing "property of the estate."    Where, as here, the trustee does not pursue exempt assets, since they are of no benefit to the creditors, the debtor is empowered to intervene in the proceeding and pursue those assets.  See H.Rep. No. 595, 95th Cong.2d Sess., at 362-63, reprinted in 1978 U.S.Code Cong. & Ad.News at 5787, 5963, 6318-19


4
 Section 547 deals with preferential transfers.  Although setoffs might otherwise be treated as preferential transfers, section 547 is not applicable because section 553(a) provides that:
Except for as otherwise provided in this section and in section 362 and 363 of his title, this title does not affect any right of a creditor to offset a mutual debt owing by such creditor to the debtor that arose before the commencement of the case under this title against a claim of such creditor against the debtor that arose before the commencement of the case ....
Our reading of this language is that, where a setoff right is being asserted, section 553, rather than section 547, governs the creditor's rights.   See F.D.I.C. v. Bank of America, 701 F.2d 831, 836 (9th Cir.1983).


5
 In the "common law" era of pleading, a defendant could not assert a separate claim against a plaintiff in the same proceeding.  "Setoff" and "recoupment" developed as exceptions to that rule.  Setoff allowed a reduction of plaintiff's claim by the amount of a liquidated claim of the plaintiff to the defendant;  recoupment allowed a defendant to assert a claim arising out of the same transaction as the plaintiff's claim.  See J.G. Sutherland, The Law of Damages Secs. 168-190 (recoupment), 198-204 (setoff of judgments) (4th ed. 1916);  Loyd, The Development of Set-Off, 64 U.Pa.L.Rev. 541, 562-63 (1916)


6
 Set-off was first recognized in American bankruptcy law in 1800, and was included in the first permanent federal bankruptcy law, passed in 1898.  See 4 Moore, Oglebay & King, Collier on Bankruptcy (14th ed.) Sec. 68.01 at 843-44


7
 The Bankruptcy Court's analysis of this issue is fundamentally flawed because it does not take account of this limitation on setoff.  The court held that SSA had a "statutory right of setoff."    This right, however, is limited by section 553.  Since section 506 only creates "secured creditor" status for creditors with rights of setoff under section 553, and the right of SSA to set off the overpayment against post-petition benefits runs afoul of a limitation of setoff contained in that section, SSA was not entitled to "secured status" as to the amount of the overpayment not yet recovered at the time the petition was filed and thus not entitled to adequate protection under section 362


8
 But cf. In re Maine, 32 B.R. 452 (Bankr.W.D.N.Y.1983) (recoupment by state from post-petition unemployment benefits allowed)


9
 See also In re Searles, 445 F.Supp. 749 (D.Conn.1978) (earned income credit, paid to taxpayer/debtor with tax refund, is not attributable to pre-bankruptcy earnings but rather is a social welfare payment received post-bankruptcy, and therefore is not "property of the estate")


10
 This case does not present the same type of problem as United States v. Norton, 717 F.2d 767 (3d Cir.1983).  The question in Norton was whether, after the petition was filed, the IRS could withhold part of a debtor's tax refund as a setoff against a prior tax underpayment.  The court held that the setoff was subject to the automatic stay.  In this case, we are confronted with a pre-bankruptcy setoff, which is not covered by Norton, and an attempted post-bankruptcy setoff, which we hold is substantively barred by 11 U.S.C. Sec. 553


11
 Section 553(b) reads:
(1) except with respect to a setoff of a kind described in section 362(b)(6) or 365(h)(1) of this title, if a creditor 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 insufficiency on the date of such setoff is less than the insufficiency on the latter of--
(A) 90 days before the date of the filing of the petition;  and
(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.


12
 For example, the House Report on section 553 cites the situation in which a debtor has $5000 on deposit ninety days before the petition is filed, and $8000 on deposit on the day the petition is filed.  H.R.Rep. No. 95-595, 95th Cong.2d Sess. at 185, 1978 U.S.Cong. & Ad.News at 6145


13
 Under our approach SSA would be obligated to Lee for three months benefits, or $1218.60, ninety days before the filing.  There would therefore be no "insufficiency" at that time, but a $472.10 "excess" of debts to the debtor over claims against the debtor


14
 Under the principles of the Supreme Court's decision in United States v. Whiting Pools, Inc., --- U.S. ----, 103 S.Ct. 2309, 76 L.Ed.2d 515 (1983), a debtor may recover collateral transferred to a secured creditor within ninety days of bankruptcy, subject to the provision of adequate protection, if the property is necessary to effect a reorganization or rehabilitation.  These principles, although theoretically applicable to a setoff as well as a foreclosure on collateral, are inapplicable to this case.  Lee has made no showing that possession of the money set-off before the petition was filed is in any way useful to the consummation of her Chapter 13 plan, and has also made no offer of adequate protection for SSA's right to the $306 in pre-bankruptcy setoff


