
414 P.2d 526 (1966)
147 Mont. 450
GENERAL INSURANCE COMPANY OF AMERICA, a Corporation, Plaintiff and Appellant,
v.
STATE HIGHWAY COMMISSION et al., Defendants and Respondents.
No. 10898.
Supreme Court of Montana.
Submitted April 4, 1966.
Decided May 3, 1966.
Hall, Alexander & Kuenning, John C. Hall (argued), Great Falls, for appellant.
Forrest H. Anderson, Atty. Gen., Donald A. Douglas, Asst. Atty. Gen., Helena, Gene *527 Huntley (argued), Baker, Chadwick H. Smith (argued), Helena, for respondents.
JOHN C. HARRISON, Justice.
This is an appeal from the decision of the Honorable Lester H. Loble of the district court of the First Judicial District of the State of Montana in and for the County of Lewis and Clark. The case was tried without a jury.
The action arises out of conflicting claims to funds retained by the state under two highway projects. The United Construction Company, Inc., was the general contractor on both projects. The plaintiff-appellant General Insurance Company of America was surety on both contracts. Susa Construction Company, one of the defendant-respondents, was a sub-contractor on the second of the two contracts, and the other defendant-respondent, the American Casualty Company was the insurer against bodily injury and property damage for United.
The two contracts will be referred to as S-45 which was let in 1958 and formally accepted by the Highway Commission on July 21, 1959, and S-95 which was executed on July 29, 1959, and formally accepted by the Highway Commission on July 18, 1960. The State, by virtue of the contracts has retained $6,428.49 on S-45 and $7,902.95 on S-95.
At the time General became surety on each contract it took from United an application and agreement of indemnity containing written assignments by United to General of certain items, including the retained funds here in issue, although the contracts contained the following proviso:
Section 08.01, para. 2. "The Commission will not recognize nor accept an advance `blanket' assignment by the contractor to any bank or other third party under the provisions of which all payments due, or to become due, the contractor are proposed to be paid direct to such third party rather than to the contractor. The Commission will recognize a request by the contractor to deposit payments to his credit in any stipulated bank." In this action the plaintiff-appellant contends that its agreement with United was not a general assignment, and therefore, was not submitted to the Highway Commission for approval.
In addition to the above provisions the contract contained the following pertinent provisions concerning the bond:
Section 09.10 reads as follows:
"The statutory time, ninety (90) days, for filing claims against the contract bond shall date from the day of final acceptance of the Project by affirmative action of The Commission  see Sections 6-401 to 6-404, inclusive, Revised Codes of Montana, 1947, as amended.
"The Commission reserves the right to withhold payment of the contractor's final estimate until any and all just claims filed with The Commission against the contract bond have been settled. If there are no claims filed within the thirty day period following the formal acceptance of the Project by affirmative action of The Commission, payment of the final estimate will be made.
"Also, should a claim or claims be filed with The Commission against the contract bond after the stipulated thirty day period has expired and the final estimate has not yet been paid, the Commission reserves the right to withhold said final payment until notice of satisfaction of claim or claims has been received."
Susa Construction Company sub-contracted for United on project S-95. The sub-contract was made on May 15, 1960, and completed on July 14, 1960. Susa furnished $1,561.96 worth of materials and $1,119.40 in labor for a total of $2,681.36. Shortly after completion Susa contacted the president of United about being paid for his work and from the conversation he learned that United was unable to pay. He then immediately called the division office of the Highway Department at Glendive but received no advice. Susa then wrote a letter to the division engineer listing his material and labor costs. This letter was not acted upon by that office nor was it forwarded *528 to the state office. The division engineer testifying at the trial why he took no action stated he "didn't recognize it as being a claim, but simply a list of his earnings on the project." This even though the State Highway Commission had accepted the project on July 18, 1960, thereby beginning the statutory 90 day period for presenting claims against the bond of General. Susa did nothing more about the matter until October 20, 1960, two days after the 90 day period, when he again contacted the Glendive office. He was told to call the Helena office of the Highway Commission where he was informed that though the 90 day period had run for claims under the bond he could still file a claim with the Commission against the retained earnings on deposit. Such a claim was made and received by the Commission on October 31, 1960. At the time of his claim the State was in possession of $7,902.95 to "liquidate unsatisfied claims" under S-95.
During the period of the last contract S-95, United Construction Company became insolvent and unable to pay for labor and materials furnished. Apparently numerous creditors filed their claims within the 90 day proviso, for between January 9, 1961, and February 7, 1961, General paid out $38,982.25 to labor and material suppliers. It refused Susa's claim on the grounds it was filed 10 days late even though the State Highway Commission had informed General that Susa's claim would have to be honored before the State would pay out the remainder withheld to "liquidate unsatisfied claims."
General obtained an assignment from each of the persons it paid as surety and filed these with the Highway Commission on February 17, 1961, along with notices of the indemnity agreements.
While General devoted much of its argument to the force and effect of its assignments, and to section 08.01, para. 2, concerning "blanket assignments" we find that neither give General a preferential position as to the retained fund.
Susa, in the meantime, sued United and attached the retained percentages on the same day, February 17, 1961, as General filed its assignments.
The facts concerning American Casualty Company arise from the purchase by United of policies covering bodily injury and property damage covering both S-45 and S-95. The amount due was $1,523.72. These policies were purchased in compliance with the insurance requirements contained in the Standard Specifications and had to be filed with the State Highway Commission before the contracts could be approved.
American did not file against the surety bond, but on or about July 30, 1962, commenced action against United and served writs of attachment upon the State Auditor attaching funds retained by the State under the construction contract. General brought this action against defendants in August 1961 and joined American as a party after it levied its attachment.
Neither Susa nor American claim under the surety bond, both admitting that their claims were too late. Rather, they bring their actions under the contract. It is this distinction, that makes our consideration somewhat narrower than all of the bond provisions previously quoted.
While plaintiff-appellant General sets forth some 20 specifications of error and 8 contentions, we believe that all questions can be resolved by answering: Who is entitled to the balance of funds retained by the State?
Incorporated into the contract and becoming part of such contract were provisions of the 1959 edition of the "Standard Specifications for Road and Bridge Construction." Several paragraphs are of import in deciding the equities of this dispute concerning the State's purpose in retaining a portion of the payments pending satisfactory completion. Section 09.09, Partial Payments, provides: "* * * the Commission shall at all times retain an amount sufficient to enable the State to complete the unaccepted or uncompleted *529 work in the contract and liquidate unsatisfied claims." (Emphasis supplied.)
As has previously been set forth in this opinion under the second, third and fourth paragraphs of section 09.10, paragraph two states: "The Commission reserves the right to withhold payment of the contractor's final estimate until any and all just claims filed with the Commission against the contract bond have been settled. * * *." (Emphasis supplied.)
The fourth paragraph of section 09.10 states: "Also, should a claim or claims be filed with The Commission against the contract bond after the stipulated thirty day period has expired and the final estimate has not yet been paid, The Commission reserves the right to withhold said final payment until notice of satisfaction of claim or claims has been received." (Emphasis supplied.)
Here within the provisions of the contract itself are protections built in not only to protect the State in case the contractor did not complete the work, but additional protections to cover and liquidate unsatisfied claims. While recognizing that the 90 day statutory period for filing claims against the bond would begin from the date of final acceptance by the Commission the contract still allowed the Commission to withhold final payment until notice of satisfaction of claims had been received.
While defendant-respondents make no contention that their claims were submitted to General before the termination of the 90 day statutory period, it is undeniable that the State had been notified, particularly in the case of Susa, that he had not been paid, and that the State had by letter notified General that the claim must be paid. Too, that because of these claims the State refused to pay over the retained funds until final settlement was made.
Had the United Construction Company not become insolvent, the State under these contracts could not have paid over to United the retained funds knowing that there were outstanding debts unpaid, and even though the claims were not submitted within the 90 day statutory period the defendant-respondents could have sued United and could then have attached the retained funds in the hands of the State. At the very best, General stands in no better position as to the retained funds than United would have had it not become insolvent necessitating its surety General, taking over its obligations. United had no rights to claim the retained funds until the outstanding claims had been paid.
The appellant claims that having paid the outstanding debts presented to it during the 90 day statutory period, which were labor and materialmen's obligations, that as an equitable matter it should be at least allowed to share with respondents on a pro-rata basis, the funds which have been retained by the state.
With this contention we find no merit. This court speaking through Chief Justice James T. Harrison in the case of Bower v. Tebbs, 132 Mont. 146, 314 P.2d 731, said: "Concerning the nature of the doctrine of subrogation it is said:
"`The object of subrogation is the prevention of injustice. It is designed to promote and to accomplish justice, and is the mode which equity adopts to compel the ultimate payment of a debt by one who, in justice, equity, and good conscience, should pay it. It is an appropriate means of preventing unjust enrichment. The doctrine of subrogation is applied to subserve the ends of justice, to do equity in the particular case under consideration, and to prevent fraud or relieve from mistake.' 83 C.J.S. Subrogation § 2 c, pp. 581, 583."
Mr. Justice Cardozo speaking for the United States Supreme Court in the case of American Surety Co. v. Westinghouse Electric Mfg. Co., 296 U.S. 133, 56 S.Ct. 9, 80 L.Ed. 105, said:
"Liability to pay was ended, but equities growing out of the suretyship relation survived in undiminished force. Acquittance under the bond did not leave the surety at liberty to prove against the assets of the insolvent principal on equal terms with the materialmen, still less to go ahead of them. *530 The settled principles of the law of suretyship forbid that competition. Jenkins v. National Surety Co., 277 U.S. 258, 266, 48 S.Ct. 445, 72 L.Ed. 874. A surety who has undertaken to pay the creditors of the principal, though not beyond a stated limit, may not share in the assets of the principal by reason of such payment until the debts thus partially protected have been satisfied in full."
Here the bond was intended to protect materialmen and laborers who worked on the job from United's insolvency. They could have recovered had United not become insolvent irrespective of what their rights against the surety might have been. Consequently, the surety cannot claim under subrogation or indemnity for money paid some creditors for whose benefit the bond was intended and be allowed to reduce the insolvent United's interest in the retained fund as against unpaid creditors.
Concerning the claim of the defendant-respondent American Casualty Company which did not arise until July 30, 1962, several questions were raised.
1. Does the doctrine of equitable subrogation aid General?
2. Does the assignment from the contractor United aid General?
3. Does the assignment to General, from claimants it paid, aid General?
4. What effect is to be given to the failure of American to perfect a claim against the bond?
5. Has American made an election by attaching so as to be precluded from maintaining this action?
Having previously considered the first four questions, in considering the Susa question and having found that General obtained no preferential position we will discuss the remaining matter as it concerns the American claim.
Testimony at the trial clearly showed that the policies were purchased, and approved by the Commission, in compliance with the insurance requirement contained in the Standard Specifications. Without the insurance, United could not have been granted either S-45 or S-95. There is no question that United failed to pay the premiums owing and General stipulated that the unpaid premiums were due. American did not file under the bond, nor does it claim under the bond, rather, it bases its claim against the retained funds on the theory that the State cannot release these funds untill all labor, material and others "supplying provisions" have been paid. Suit was commenced against United within the statutory time, and a writ of attachment issued against the state auditor who still retained the funds.
Considering whether or not the insurance premiums are covered by the provision in the contract which includes "supplying provisions" we feel clearly they are so included. United was required to pay all persons who supplied provisions for the prosecutions and completion of the work; American provided the casualty insurance without which the contract could not have been let and American has not been paid.
Both Susa Construction Company and American Casualty Company are entitled to be paid out of the retained funds held by the state auditor and upon such payment the General Insurance Company of America is to be paid the balance.
The decision of the district court is affirmed.
JAMES T. HARRISON, C.J., and DOYLE, ADAIR and CASTLES, JJ., concur.
