
626 F.Supp. 1367 (1986)
Jerry M. HATCH, Plaintiff,
v.
Margaret M. HECKLER, Secretary of Health and Human Services, Defendant.
No. C-85-3931-WWS.
United States District Court, N.D. California.
February 6, 1986.
*1368 Catherin Ellis, Fremont, Cal., for plaintiff.
Judith A. Whetstine, Asst. U.S. Atty., San Francisco, Cal., for defendant.

MEMORANDUM OF OPINION AND ORDER
SCHWARZER, District Judge.
Plaintiff commenced this action under 42 U.S.C. § 405(g) to obtain judicial review of a final decision by the Secretary of Health and Human Services that disability benefits payable on plaintiff's earnings account are subject to reduction because of plaintiff's receipt of a state workers' compensation settlement arising from the same injury. The action comes before this Court on cross-motions for summary judgment.
Federal disability benefits are subject to reduction when the person on whose earnings account the benefits are paid also obtains periodic workers' compensation benefits. 42 U.S.C. § 424a(a). This offset provision also covers lump sum workers' compensation awards or settlements when they are a commutation of, or substitute for, periodic payment of benefits. 42 U.S.C. § 424a(b). Portions of a workers' compensation award or settlement allocated to past or future medical expenses, however, are excluded from the operation of the offset provisions. 20 C.F.R. § 404.408(d).
Plaintiff contends that his workers' compensation settlement was a lump sum amount for specified purposes at a particular point in time, and therefore was not subject to being offset as an award in lieu of periodic benefits under 42 U.S.C. § 424a(b). He also contends that the entire settlement amount was less than his past and future medical expenses and for that reason too not subject to being offset under 20 C.F.R. § 404.408(d).

FACTUAL BACKGROUND
Following an undisputed determination that plaintiff suffers from total disability, plaintiff and his dependents were found entitled to disability benefit payments. On May 29, 1983, plaintiff was notified that benefits payable to his dependents were subject to offset because he had received a *1369 workers' compensation settlement related to his injury. This determination was upheld on reconsideration by the Social Security Administration. Plaintiff then requested a hearing before an administrative law judge (ALJ), who considered the case de novo. The ALJ determined that the benefits payable on the plaintiff's earnings account were subject to offset because of the workers' compensation settlement. The Appeals Council, after considering additional evidence, adopted the ALJ's determination as the final decision of the Secretary on April 24, 1985.

EVIDENCE PRESENTED TO THE ALJ
The evidence before the ALJ showed that plaintiff filed a claim for disability benefits on August 29, 1978. In view of plaintiff's total disability owing to quadriplegia, he was awarded benefits which would continue until the earlier of age 62 or his death. His wife and children were also found entitled to benefits on his account. But in May 1982, the Social Security Administration, after being notified of the workers' compensation settlement for plaintiff, determined that a reduction in benefits was appropriate.
The settlement consisted of the following documents, all in the record:
 an order of the California Workers' Compensation Appeals Board approving the settlement (as required by California law);
 a standard Compromise and Release (C & R) form used by the Board;
 an Addendum (referred to in paragraphs 5 and 11 of the standard form) specifying the allocation of the settlement amount and certain restrictions on its disbursement, and reciting release of statutory workers' compensation liability against the employer and the insurance carrier;
 a "Baird Formula" calculation related to the satisfaction of the lien of the California Employment Development Department ("EDD") for unemployment benefits paid on account of plaintiff's disability;
 and a "Gregory Calculation," a mandatory calculation related to the satisfaction of a lien of the California Laborers Health & Welfare Trust Fund.
The order approving the C & R recited a settlement amount of $131,090.40, payable according to "the provisions of paragraph 5 and Addendum of the compromise and release ..." The standard C & R form summarized the details of the claim. In paragraph 6, the form recited that unpaid medical bills were "in dispute," and that future medical and hospital expenses were estimated at "$ unknown. Unpaid future medical and hospital expense ... assumed as follows: all by applicant." Paragraph 9 recited the existence of disputes as to the liability for the injury and the need for past and future medical care, and stated that the parties are settling the matter "to avoid the hazards of litigation and buy their peace."
The Addendum related to paragraphs 5 and 11. As to paragraph 5, the Addendum detailed the allocation of the settlement to several purposes: purchase of a residence for plaintiff, renovations of the residence, property taxes and assessments related to the purchase, and amounts to settle attorney's fees and state liens. The Addendum specified that the settlement amount was to be paid to plaintiff in a lump sum in a blocked bank account, with disbursements from the account only upon the order of the Appeals Board and only for the specified purposes. The Addendum also recited that Medi-Cal waived its lien for medical care costs. A letter from the California Attorney General's Office confirmed this lien waiver, conditioned on settlement on the terms ultimately agreed to, and confirmed plaintiff's continuing Medi-Cal eligibility. As to paragraph 11 of the C & R, the Addendum recited release of the employer and the insurance carrier from all further workers' compensation liability for plaintiff's injury.
The "Baird Formula" was required by California Labor Code § 4904 (West 1971). This section protects liens of the EDD on workers' compensation settlements. The *1370 Baird Formula is a method of reducing such liens proportionately. when a worker's claim is settled for less than its full amount. The formula was approved by the California Supreme Court in California-Western States Life Insurance Co. v. Industrial Accident Commission (Baird), 59 Cal.2d 257, 28 Cal.Rptr. 872, 379 P.2d 328 (1963). It seeks to assure fairness in proportional reductions of EDD liens by showing a reasonable estimate of the full value of the claims a if the worker had prevailed. Thus, the Baird Formula for Hatch's claim showed amounts for permanent disability ($214,644.00), past medical expenses not reimbursed ($109,292.00), and future medical treatment ($716,169.00), for a total value of $1,040,105.00. These figures, in conjunction with the actual settlement amount, then establish the proportion of EDD's lien which might reasonably be paid from the settlement. The "Gregory Calculation" is a similar device for the proportional payment of other lien claims against the settlement, under California Labor Code § 4903.1 (West Supp.1985) and Kaiser Foundation Hospitals v. Workers' Compensation Appeals Board (Gregory), 87 Cal.App.3d 336, 151 Cal.Rptr. 368 (1979), and Hatch's claim recited the same figures here as for the Baird Formula.
Also in the record as additional evidence before the Social Security Appeals Council is a letter from the insurance carrier's attorney to Hatch's then attorney giving his expert opinion on the meaning of the recitals of past and future medical expenses in paragraph 6 of the C & R form. According to counsel it is customary to state in a compromise and release that medical expenses are "in dispute" and future expenses "unknown" and that those statements do not contravene the specific figures provided in Baird and Gregory computations and approved by the Board.
Also in evidence were letters between attorneys for plaintiff and the employer's insurance carrier concerning settlement discussions. These letters show the development of a settlement the bulk of which was intended to enable plaintiff to acquire a home and remodel it as necessary to make it suitable for use by him as a disabled person. Also in evidence were orders of the Workers' Compensation Appeals Board directing the disbursement of funds from the blocked bank account established by the settlement. The first disbursement order, on December 23, 1981, released funds for the purchase of a house, and the second, on August 9, 1982, released funds for the medically recommended renovations. The second order exhausted the funds due plaintiff under the settlement.
The ALJ found that the plaintiff had medical, legal, or related expenses, including remodeling costs to make the house suitable for use by a severely handicapped person, not subject to being offset in the amount of $44,190.40. The ALJ found that $86,900.00, the balance of plaintiff's workers' compensation settlement, was to be offset to reduce the disability benefits payable on plaintiff's account.

APPLICABLE LAW AND DISCUSSION
On judicial review under 42 U.S.C. § 405(g), the Secretary's decision will be upheld unless it is based on legal error, or is not supported by substantial evidence viewing the record as a whole. Allen v. Heckler, 749 F.2d 577, 579 (9th Cir.1984). "Substantial evidence ... means such relevant evidence as a reasonable mind might accept as adequate to support a conclusion." Id. (quoting Richardson v. Perales, 402 U.S. 389, 401, 91 S.Ct. 1420, 1427, 28 L.Ed.2d 842 (1971)). The decision of the Secretary will be set aside, however, if the proper legal standards were not applied in weighing the evidence and making the decision even though the findings are supported by substantial evidence. Benitez v. Califano, 573 F.2d 653, 655 (9th Cir.1978). "As a general rule, the interpretation of written contracts is a matter of law," and is so reviewed. Energy Oils, Inc. v. Montana Power Co., 626 F.2d 731, 734 (9th Cir.1984).
The first issue presented is whether the award, being a lump sum award, falls within the offset provisions of 42 U.S.C. *1371 § 424a(a) providing for the reduction of benefits by the amount of periodic benefits received under a workers' compensation law. Section 424a(b) provides that if a periodic benefit is payable other than on a monthly basis, the reductions shall be made as determined by the Secretary, unless the "benefit is payable as a lump sum." If, however, a lump sum benefit "is a commutation of, or a substitute for, periodic payments," the offset provisions nevertheless apply.
The undisputed evidence shows that the lump sum payment was made on account of a settlement which expressly relieved the employer from any further workers' compensation liability. "Where the right to and liability for periodic workers' compensation benefits are thus extinguished by a voluntary settlement, the settlement can only be regarded as a `substitute' for the payments." Black v. Schweiker, 670 F.2d 108, 110 (9th Cir.1982). The Secretary, under § 424a(b), is thus required to offset such a lump sum settlement against the plaintiff's federal benefits to approximate the result called for by § 424a(a).
The second issue presented is whether all or any part of the $86,900 which would otherwise have to be offset qualifies for exclusion under the regulation which states:
Amounts paid or incurred, or to be incurred, by the individual for medical, legal, or related expenses in connection with the claim for public disability payments ... or the injury or occupational disease on which the public disability award or settlement is based, are excluded in computing the reduction to the extent they ... reflect either the actual amount of expenses already incurred or a reasonable estimate, given the circumstances in the individual's case, of future expenses. Any expenses not established by evidence required by the Administration or not reflecting a reasonable estimate of the individual's actual future expenses will not be excluded. These medical, legal, or related expenses may be evidenced by the public disability award, compromise agreement, a court order, or by other evidence as the Administration may require.
20 C.F.R. § 404.408(d).
Plaintiff argues that because his past and future medical expenses far exceed the amount paid to him in settlement, the full settlement must be excluded. The ALJ rejected the argument on the ground that the settlement "agreement specifically required that the lump sum be used for the purchase of a residence and additional expenses related to that residence. Therefore, under the terms of the agreement, the funds could not have been used to pay past or future medical expenses, and, in fact, they were not."
Appellate courts have taken different approaches to the resolution of this problem. In Iglinsky v. Richardson, 433 F.2d 405 (5th Cir.1970), the court held that where Louisiana law provided for a specified medical benefit payable separately by the employer and no part of the award itself was specifically attributable to medical expenses, the entire award was properly offset against disability payments. Alternatively, in Worley v. Harris, 666 F.2d 417 (9th Cir.1982), the court held the entire award to be properly offset because under the settlement agreement the worker agreed to be responsible for any future medical expenses.
The Senate Report on the amendment providing for the offset states that the Secretary would not offset any part of workers' compensation benefits which are equal to amounts paid or incurred by the worker for medical expense "except to the extent that special provision is made in the award to cover them or they are provided without cost to the worker." S.Rep. 404, 89th Cong. 1st Sess.1965, U.S.Code Cong. & Adm.News, pp. 1943, 2201, quoted in Iglinsky, supra, 433 F.2d at 408.
It is quite clear that the intent of Congress was to prevent collection of duplicate benefits. Thus, if the workers' compensation award, or settlement, represents benefits on account of the worker's disability, *1372 the federal disability payments will be reduced pro tanto. However, to the extent the workers' compensation benefits defray medical expenses, there is no duplication with federal disability benefits and those benefits therefore are excluded from offset.
In Iglinsky, Louisiana law specifically provided that medical expenses are to be paid by the employer and are not covered by the workers' compensation award. Hence that award was subject to being offset. In Worley, the court interpreted the terms of the compensation settlement (probably erroneously) as excluding medical expenses; the court relied on boiler-plate in the settlement agreement relieving the employer and the carrier from future liability for medical expenses.
In the instant case, special provision was made for medical expenses primarily in a negative sense: the Medi-Cal lien for past medical expenses was waived, future eligibility for Medi-Cal benefits was guaranteed, and a mandatory allocation to non-medical purposes was made of the major part of the award. Under the terms of the settlement, payments of medical expenses clearly had to be made from sources other than the award and hence none of the $86,900 could be excluded from offset. Although there is here no specific provision for the payment of medical expenses, the effect of the mandatory allocation of the benefits is essentially the same as the provision made in Iglinsky.
It is true that the Secretary's regulation is not free from ambiguity. If an award were made, or settlement paid, which was not specifically allocated to some purpose, the fact that medical expenses in excess of the award were expected to be incurred by the worker in the future would presumably suffice to exclude the amount from offset. But to apply that reasoning to a settlement which precludes the use of the money for medical purposes would frustrate the purpose of the regulation to prevent receipt of duplicate disability benefits. Where, as here, the workers' compensation benefit is mandated to be used purely as a disability benefit (with medical expenses to be paid from other sources), excluding it from the offset calculation would clearly result in duplication.
Accordingly, defendant's motion for summary judgment will be granted.
IT IS SO ORDERED.
