This appeal in a bankruptcy proceeding presents the following questions for our determination:
1. Whether the sum of $39,711.11 paid as wages by The Home Indemnity Company (Surety) between the date of contractual default (March 31, 1960) of F. H. Donovan Painting Co., Inc. (Bankrupt), and the date of Donovan’s bankruptcy (May 4, 1960), constituted wages within the meaning of §§ 64, sub. a(2) of the Bankruptcy Act, Title 11 U.S.C.A. § 104, sub. a(2), requiring allowance as a wage priority claim.
2. Whether the wage priority claim allowed in favor of Surety in the amount of $17,974.25 for wages due workmen prior to Donovan’s default was properly subordinated in full to payment of the tax claimed by the United States in the amount of $31,855.91 and the tax claimed by the State of Texas in the amount of $2,995.27.
The memorandum opinion of the Referee in Bankruptcy which incorporated his findings of fact and conclusions of law, was adopted in toto by the district court and appears as part of the court’s order affirming the action of the bankruptcy court. In Re F. H. Donovan Painting Co., E.D.Mo., 220 F.Supp. 811 (1963). Surety has appealed.
There is no dispute as to the facts. They were stipulated and Surety concedes that the factual findings of the referee, appearing in his memorandum opinion, are correct. This being so, we forego another detailed recitation of the factual background and shall confine our review of the facts to those deemed essential to a proper understanding and disposition of the issues before us.
Donovan was the subcontractor of Robertson Construction Company by virtue of five separate written contracts with Robertson, identical as to pertinent terms, obligating Donovan to paint 500 housing units at Fort Hood, Texas. Separate labor and material bonds and separate performance bonds were executed by Donovan as principal and The Home Indemnity Company as surety, in which Robertson, the general contractor, was named as obligee. The five contracts totaled $258,500, and the five performance bonds were for one-half of that amount, or $129,250.
On March 31, 1960, Donovan notified Surety that it was unable to meet current payrolls, considered itself in default of its obligations under the contracts, requested Surety to make preparations to complete the project, and advised that a voluntary petition in bankruptcy would be filed. A similar notice was given Robertson. On the same day Donovan stopped operations, Surety took over, and thereafter completed the project.
From March 31, 1960, to date of bankruptcy, May 4, 1960, Surety paid wages to workmen in the sum of $39,711.11; additionally, Surety paid the sum of $17,974.25 as wages to workmen who had been employed by Donovan and which was due them from the latter at the time it defaulted in the performance of the contracts. The workmen duly assigned their wage claims against Bankrupt to Surety for the amounts paid to them by Surety.
Surety filed a claim in the bankruptcy court for a total of $90,141.68; $17,974.-25 was allowed as a wage priority claim, and $64,611.43 was allowed as a general unsecured claim.
Bankrupt owed the United States for taxes in the total amount of $31,855.91, and a tax priority claim of the fourth class was allowed for this amount. Of this total, only $13,987.88 ($3,333.08 in F.I.C.A. Taxes and $10,654.80 in withholding taxes) was incurred on the Fort Hood job bonded by Surety, while the balance of the claim was for taxes due the United States unrelated to the bonded project.
Bankrupt also owed the State of Texas $2,995.27 for state unemployment taxes which were incurred on the Fort Hood project, and a tax priority claim was allowed Texas for this amount.
Having determined that Surety was entitled to a wage priority in the amount *873of $17,974.25, the bankruptcy court then concluded that the priority claim should be subordinated in payment to the claims of the United States and the State of Texas. See 220 F.Supp. at 821-822.
Surety first contends, as it did below, that the amount it paid as wages, $39,711.11, from Donovan’s default to the date of Donovan’s bankruptcy, should also be allowed as a wage priority claim, asserting that it “claims priority on all of these wages paid by reason of the assignment placed on the reverse side of each of said checks prior to delivery to the workmen.”
But Surety has failed to recognize that the amounts which it paid for work and labor performed on the project after Bankrupt’s default on March 31, 1960, was not in discharge of wages due from Bankrupt. The facts show and the referee found that,
“At that time the surety company took possession of the work under the contract and completed same in accordance with its contractual obligation and right so to do. It did not subcontract the work, but hired direct some of the employees who had been working on the job, and hired other new employees. It deducted income withholding and payroll taxes, federal and state, and paid same to the -governments. It supervised and controlled the work. Donovan Painting Company, the bankrupt corporation, did not participate in the operation after it defaulted and abandoned the contract. The workers who were paid these wages during this period were employees of the surety company, and not of the bankrupt.” 220 F.Supp. at 817.
This finding is binding upon Surety and in our view is dispositive of its contention. We have considered In Re Dutcher, W.D.Wash., 213 F. 908 (1914), relied upon by Surety, and for the reasons stated by the bankruptcy court, 220 F.Supp. at 817, we too conclude that Dutcher is not controlling and does not require an allowance of the amount in question as a wage priority claim.
The second issue to be resolved, relating to the subordination of Surety’s $17,-974.25 claim — -undisputed as a wage priority — to payment of the tax priority claims of the United States and the State of Texas, presents a two-pronged question. First, whether Donovan was obligated under the subcontracts to pay taxes which were incurred on the Fort Hood project. Surety asserts that there was no contractual obligation imposed upon Donovan to pay such taxes; there was no liability under the performance bonds for payment of these debts of the bankrupt Donovan; and consequently no basis for subordinating its second class claim to payment of the fourth class claims of the United States and Texas. Secondly, the argument is made that Surety’s claim is for wage priorities, not as á surety, but as assignee of the wage earners, and thus should not be subordinated to payment of any portion of the tax claims, and in no event should be subordinated to payment of taxes due the United States from Bankrupt which were not related to the Fort Hood project.
The first of these contentions must be resolved against Surety.
• [2, 3] Each of the subcontracts contained this provision:
“Subcontractor shall accept full and exclusive liability for the payment of any and all taxes and contributions for unemployment insurance, old age retirement benefits and life pensions and annuities which may now or hereafter be imposed by the United States or any State, * * *. Subcontractor shall likewise pay any and all taxes, sales taxes, use taxes, excise assessments or other charges levied by any governmental authority on or because of the work to be done hereunder, or any equipment, supplies or materials used in the performance thereof.” (Emphasis supplied).
Each of the performance bonds was conditioned upon faithful performance by *874the principal (Donovan) of the respective subcontract. The bonds also specifically-referred to the subcontracts and provided that such “subcontract is by reference made a part hereof.” It is a fundamental rule of construction that where the contract which is the subject of the performance bond is referred to in the latter, that the contract is to be regarded as a part of the undertaking of the surety under the bond. Massachusetts Bonding & Insurance Co. v. Feutz, 8 Cir., 182 F.2d 752, 756-757 (1950); United States v. Phoenix Indemnity Co., 4 Cir., 231 F.2d 573, 575 (1956). It is equally well-settled that where, as here, there is a compensated surety, the performance bond and the contract upon which it is based are construed most strongly against the surety and in favor of indemnity. American Casualty Co. of Reading, Pa. v. Brezina Const. Co., 8 Cir., 295 F.2d 603, 607, fn. 6 (1961); Massachusetts Bonding & Insurance Co v. Feutz, supra, 182 F.2d at 756.
Surety argues that the contractual provision above set out does not constitute a promise to pay taxes but is “merely a statement that the Subcontractor Donovan is liable for the payment and consequently will indemnify the general contractor Robertson for any liability which Robertson might have for the payment of such taxes, etc., if Donovan did not pay. This is merely a declaration of the subcontractor’s existing liability under the tax laws, and did not create any liability on the part of the subcontractor for the payment of those taxes which did not already exist.” In our view, this argument is contrary to the clear language of the questioned clause of the subcontracts under which Donovan accepted full and exclusive liability for the payment of any and all taxes. Our holding that this provision imposed an obligation upon Donovan to pay the social security withholding, and unemployment taxes is fortified by the subsequent clause in the same paragraph of the subcontracts under which it was agreed that “Subcontractor shaM likewise pay any and all taxes, sales taxes, * * * [etc.].” (Emphasis supplied).
The fact that Robertson Construction Company was named as the obligee in the performance bonds does not militate against the right of the United States Government and the State of Texas to recover under the bonds for taxes incurred on the project. Donovan contractually obligated itself to pay such taxes; Surety — to the extent of its liability under the bonds — guaranteed the faithful performance of the subcontracts, and actually took , over the work after Donovan’s default; and thus, inasmuch as the bonds were made for the protection of both governments, either or both could have maintained an action on the bonds as a third party beneficiary. United States v. Phoenix Indemnity Co., supra, 231 F. 2d 573, 575.
Contrary to Surety’s insistence, we are not persuaded that the question here involved is controlled by the ease of Atlantic Refining Co. v. Continental Casualty Co., W.D.Pa., 183 F.Supp. 478 (1960).
Turning to the second phase of this issue, we note at the outset that while the entire $2,995.27 claim of the State of Texas arose from the bonded project, only $13,987.88 of the total United States claim was so incurred.
Under § 64 of the Bankruptcy Act [11 U.S.C.A. § 104], wage claims are a second priority, while tax claims — both federal and state — constitute a fourth priority. And generally, the assignment of a wage claim by a workman to a third party carries with it any priority that the workman might have had, Shropshire, Woodliff & Co. v. Bush, 204 U.S. 186, 27 S.Ct. 178, 51 L.Ed. 436 (1907), even where the assignee is a surety. In Re Dutcher Construction Corp., 2 Cir., 298 F.2d 655, 656 (1962), aff’d sub nom. Pearlman v. Reliance Ins. Co., 371 U.S. 132, 83 S.Ct. 232, 9 L.Ed.2d 190 (1962). Thus, by Act of Congress, Surety’s $17,-974.25 claim would have priority were it not for the equitable power of a federal bankruptcy court to subordinate claims *875of some creditors to those of others. According to controlling equitable principles, a surety may not share in a bankrupt’s assets ahead of or on equal terms with any creditors who are members of the class the surety’s bond had been given to protect. American Surety Co. v. Sampsell, 327 U.S. 269, 272-273, 66 S.Ct. 571, 90 L.Ed. 663 (1946); American Surety Co. v. Westinghouse Electric Mfg. Co., 296 U.S. 133, 137-138, 56 S.Ct. 9, 80 L.Ed. 105 (1935). Application of this rule to the claims before us necessitates subordination of Surety’s wage claim to the tax claim of the State of Texas and to that portion of the tax claim of the United States that arose in the course of the Fort Hood project.
But the ruling below would subordinate Surety’s claim to the entire United States tax claim. The United States seeks affirmance of this conclusion solely upon the basis of what we would consider to be an extension of the equitable principle which we found applicable to those tax claims incurred on the bonded project. Treating this phase of the case merely by footnote reference, the United States asserts that Surety cannot share in Donovan’s assets ahead of or on equal terms with the United States even as to those claims unrelated to the Fort Hood project because the United States was a member of the class the bond was given to protect. Although the authority cited by the United States — American Surety Co. v. Sampsell, supra, 327 U.S. 269, 66 S.Ct. 571, 90 L.Ed. 663 and Collier on Bankruptcy, § 57.21, p. 340 (14th ed. 1956) is sound, in our view the principle there announced cannot be extended to a situation where, as here, the taxes secured by the surety’s bond will have been satisfied in full, and it is the surety’s standing: with respect to other taxes due to the-creditor by the bankrupt, incurred after the subcontracts and bonds were executed, that is in issue.1 See In Re Buildice Co., N.D.ILL., 146 F.Supp. 911 (1956). Compare also, Prudence Realization Corp. v. Geist, 316 U.S. 89, 95-97, 62 S.Ct. 978, 86 L.Ed. 1293 (1942).
Although not discussed by the parties on appeal, the referee’s opinion reveals that his decision to subordinate Surety’s claim to the entire United States claim rather than only that portion incurred on the Fort Hood project was motivated by his interpretation of the supremacy of the dictates of the Bankruptcy Act over the equity powers of a referee.2 Certainly, § 64 of the Bankruptcy Act generally requires pro rata distribution to all creditors of the same class, where, as here, there are insufficient assets to satisfy in full all claims in that class. Seemingly, the referee and the district court were of the view that since both the claim of Texas and the entire United States claim constitute fourth class priorities, to subordinate Surety’s claim to only a portion of the United States claim resulting here in full payment to the State of Texas and only partial satisfaction of the entire United States claim, would favor the Texas claim, would thereby amount to a creation of subclasses of priorities, and thus would lead to an illegal distribution. To be sure, abundant authority can be found to support the proposition that a court cannot disregard the priority classifications established by statute and “set up a subclassifieation of claims within a *876class given equal priority by the Bankruptcy Act and fix an order of priority for the sub-classes according to its theory of equity.” In Re Columbia Ribbon Co., 3 Cir., 117 F.2d 999, 1002 (1941). See also Missouri v. Ross, 299 U.S. 72, 57 S.Ct. 60, 81 L.Ed. 46 (1936) ; In Re Delaware Hosiery Mills, 3 Cir., 202 F.2d 951, 953 (1953) ; Collier on Bankruptcy, §§ 64.02(4); 64.401(2); 65.06, p. 2293 (14th ed. 1956). However, it is likewise true that the Act does not establish inexorable rules for distribution which can never be deviated from in the interest of justice and equity. Goldie v. Cox, 8 Cir., 130 F.2d 695, 699-700 (1942) ; Bird & Sons Sales Corporation v. Tobin, 8 Cir., 78 F.2d 371, 373-374, 100 A.L.R. 654 (1935); Sampsell v. Imperial Paper Corp., 313 U.S. 215, 219, 61 S.Ct. 904, 85 L.Ed. 1293 (1941); Pepper v. Litton, 308 U.S. 295, 303-305, 60 S.Ct. 238, 84 L.Ed. 281 (1939) ; Costello v. Fazio, 9 Cir., 256 F.2d 903, 909-910 (1958); Wheeling Valley Coal Corporation v. Mead, 4 Cir., 171 F.2d 916, 920-921 (1949); Bank of America Nat. Trust & Sav. Ass’n v. Erickson, 9 Cir., 117 F.2d 796, 798 (1941); In Re Aktiebolaget Krueger & Toll, 2 Cir., 96 F.2d 768, 770 (1938). It should be pointed out that most of these cases involve complete disallowance or subordination of a claim asserted by a creditor guilty of some fraudulent or at least questionable tactic, whereas, here, the United States has a legitimate claim and is guilty of no such conduct.
However, to allow the result below to stand would also do violence to the principles of justice and equity, as would have been true in the above cited cases were it not for the court’s intervention. By way of illustration, if $25,000 in assets were available for distribution,3 the United States would receive approximately $23,076.92 — or about $9,000 more than its claim from the job the bonds were designed to protect, and Texas would receive approximately $1,923.08 — or about $1,000 less than its claim from this job. Even more inequitably, Surety would receive nothing even though its claim is of a higher classification and even though its bonds were not designed to protect the United States for any claims above those incurred on the Fort Hood project. Hypothetically, rigid adherence to the rule requiring equality of distribution on a pro rata basis to creditors of the same class would result in subordination of Surety’s second-class priority to .the entire fourth-class claims of Texas and the United States even if only $10 of the Texas claim and no portion of the United States claim arose from the bonded Fort Hood project. We do not believe that the pro rata distribution rule was intended to be applied in this manner. Any subordination made of a higher priority claim to a lower claim must be scrupulously measured and fitted to the actual injustice that would result from adherence to the statutory priority system. See In Re Kansas City Journal-Post Co., 8 Cir., 144 F.2d 791, 801 (1944). Here, beyond question, Surety’s claim must be subordinated to the tax claims incurred on the Fort Hood job, but to further subordinate it would not only serve no just cause, but would actually lead to inequities and to greater violence to the priority classification system established by the Act. It may be noted that limiting .subordination of Surety’s claim to the .extent of the bonded job results in full payment of both the United States and Texas claims incurred on the Fort Hood project.
Accordingly, we reverse that part of the judgment subordinating Surety’s $17,974.25 wage claim to the portion of the United States tax claim unrelated to the Fort Hood bonded project. In all other respects the judgment of the district court is affirmed. Reversed in part and remanded for further proceedings not inconsistent with the conclusions reached herein.
. The record before us fails to indicate the precise time period during which the other taxes due the United States were incurred, but the parties seem to have proceeded on the basis that these taxes were not due at the time the subcontracts and bonds were executed in January, 1959. Having no proof to the contrary, we too have adopted this assumption.
. The referee stated, 220 F.Supp. at 822:
“The federal and state tax claims having equal priority, in the absence of sufficient assets to pay each in full, a dividend thereon is required in distribution. Therefore, only in the event there be sufficient assets to pay both tax claims in full, can it be said that the payroll taxes included in the respective claims have been paid. It follows that the portion of Surety’s claim here found to constitute a wage priority, must be subordinated in payment to the tax claims of the United States and the state of Texas.”
. In brief and in oral argument, it was asserted without dispute that approximately $27,000 in assets remain in the estate of the bankrupt.