The plaintiffs, the Towns of Tilton and Northfield, appeal an order of the Superior Court (Hollman, J.) granting summary judgment for the State on the ground that the lack of a contract cosigned by the State precluded, as a matter of law, the plaintiffs’ claims of indemnification pursuant to RSA 149-G:2 (Supp. 1972) (current version at RSA 485-A:46 (1992)). We affirm.
*464This case presents the third appeal to this court arising from the same set of facts. See Morgenroth & Assoc’s, Inc. v. Town of Tilton, 121 N.H. 511, 431 A.2d 770 (1981) (Morgenroth I); Morgenroth & Assoc’s v. State, 126 N.H. 266, 490 A.2d 784 (1985) (Morgenroth II). We briefly review the facts underlying these cases and refer to the prior two decisions for a full statement of the facts and issues involved therein.
In 1968, Morgenroth & Associates, Inc. (Morgenroth) entered into contracts with the Towns of Tilton and Northfield (the towns) for preconstruction engineering work involving the construction of sewerage systems. When construction grant funds were not forthcoming, Morgenroth allegedly made arrangements with the New Hampshire Water Supply and Pollution Control Commission (WSPCC) and the towns to proceed with its work and be paid when the funds became available.
Morgenroth submitted its plans and drawings to the WSPCC in May 1972. After unsuccessfully attempting to obtain compensation from the WSPCC, Morgenroth filed suit against the State and the towns to recover damages for breach of contract. On appeal to this court from an order of dismissal for lack of jurisdiction, we held that the State could be sued under an implied in fact contract claim and remanded the case. See Morgenroth I, 121 N.H. 511, 431 A.2d 770.
In 1983, Morgenroth settled its actions against the towns, leaving its action against the State still pending. Under the terms of the settlements, the towns assigned to Morgenroth whatever rights they had to indemnification from the State under RSA 149-G:2 (Supp. 1972) (current version at RSA 485-A:46 (1992)). The direct contract action against the State terminated in 1983 when the trial court entered a final default judgment against Morgenroth for its failure to respond to interrogatories. Apparently this was a strategic decision based on Morgenroth’s conclusion that it was not feasible to litigate the contract action against the State.
Morgenroth then brought two new actions against the State: one action asserting that judgments entered for Morgenroth against the towns had not been satisfied; and a second action asserting, in the name of the towns, that Morgenroth had obtained judgments against the towns, which the towns had not paid, and that the towns had assigned Morgenroth their rights to require the State to pay the judgments against them. Both actions were dismissed by the trial court on grounds of res judicata. This court affirmed the dismissal of the first action and reversed the dismissal of the second. See Morgenroth II, 126 N.H. 266, 490 A.2d 784. The second action is the case currently before us on appeal.
*465The sole issue is whether a written contract cosigned by the WSPCC is a necessary prerequisite for the towns to seek indemnification from the State under former RSA 149-G:2. In resolving this issue, we look first to the statutory language itself, In re John Kevin B., 129 N.H. 286, 288, 525 A.2d 281, 282-83 (1987), and construe the law in a manner consistent with its plain meaning. Theresa S. v. Sup’t of YDC, 126 N.H. 53, 55, 489 A.2d 592, 593 (1985). To divine the intent of a statute, we determine its meaning from its construction as a whole, not by examining isolated words and phrases. Town of North Hampton v. Sanderson, 131 N.H. 614, 622, 557 A.2d 643, 648 (1989).
RSA 149-G:2 (Supp. 1972) (current version at RSA 485-A:46 (1992)), as originally enacted in 1972, provides that
“[a]ny future payments due from a municipality which has undertaken construction (or engaged in engineering study, planning or design), as outlined in RSA H9-G:l, since July 1, 1947, to pay for such construction, study, planning, or design, and the facility involved is acquired by the [WSPCC], shall hereby automatically become the obligation of the state, including engineering services and contract costs.”
(Emphasis added.) RSA 149-G:1 (Supp. 1972) (current version at RSA 485-A:45, II (1992)), in turn, states that “[t]he word ‘construction’ shall include all engineering services . . . the intent being to include within the [WSPCC] area of responsibility all work considered eligible for financial assistance under the provisions of RSA 149-B____”
Construction work eligible for financial assistance includes “engineering services ... provided the construction has been directed by the [WSPCC] . . . and the plan therefor is approved in compliance with the provisions of . . . RSA 149:4, XIII.” RSA 149-B:1 (Supp. 1972) (current version at RSA 486:1, I (1992)). Those provisions assign to the WSPCC the duty, power and authority to “approve and cosign jointly with the municipality or other governmental subdivision concerned any proposed contracts or other proposed agreements . . . for engineering services related to sewerage and other pollution control facilities.” RSA 149:4, XIII (Supp. 1972) (current version at RSA 485-A:4, XII (1992)).
Although the contract between the towns and Morgenroth was entered into in 1968 and Morgenroth submitted its plans to the towns in May 1972, two months before the enactment of RSA 149-G:2, the statute applies to these facts because it expressly refers to “construction . . . since July 1, 1947.” We hold that under the plain *466language of these statutes, RSA 149-G:2, as originally adopted in 1972, requires, by explicit reference to other statutory provisions, a written contract cosigned by the WSPCC as a prerequisite to statutory indemnification of the towns by the State.
The plaintiffs argue that requiring cosignature by the WSPCC as a prerequisite for statutory indemnification contradicts this court’s statement in Morgenroth I that “RSA 149:4 XIII empowers but does not require the water supply and pollution control commission to review, approve, and co-sign contracts for engineering services related to the construction of sewerage systems.” Morgenroth I, 121 N.H. at 518, 431 A.2d at 774. The issue before this court in Morgenroth I, however, was whether Morgenroth could bring an implied in fact contract claim directly against the State pursuant to RSA 491:8. In holding that it could do so, this court concluded that RSA 149-G:2 did not bar such a claim arising prior to the statute’s enactment. This court gave no indication whether cosignature was a prerequisite to an indemnification claim by the towns against the State. Morgenroth I, therefore, is not controlling, and the plaintiffs’ reliance on this statement is misplaced.
“The court shall grant a motion for summary judgment... if, after considering all the evidence in the light most favorable to the non-moving party, it finds that there is no genuine issue of material fact and the moving party is entitled to judgment as a matter of law.” Horse Pond Fish & Game Club v. Cormier, 133 N.H. 648, 653, 581 A.2d 478, 481 (1990). Because it is undisputed that the WSPCC did not cosign a contract with the towns for Morgenroth’s services, the trial court was correct in ruling that there is no genuine issue of material fact for trial.
The trial court found that the State was entitled to judgment as a matter of law based on the 1977 amendment to RSA 149-G:2 that states: “With respect to payments for engineering services and contract costs in connection with contracts entered into after July 1, 1967, it is the intention of this section to obligate the state only if the contract giving rise to such obligations has been entered into pursuant to the provisions of RSA 149:4, XIII.” RSA 149-G:2 (Supp. 1977) (current version at RSA 485-A:46 (1992)). The court reasoned that the towns’ claims for indemnity arose in 1983 when they executed settlement agreements with Morgenroth, and that the 1977 amendment therefore applied and expressly required a cosigned contract. As set forth above, we hold that the original 1972 statute required a cosigned contract as a prerequisite for indemnification *467and therefore we need not consider the applicability of the 1977 amendment. Even assuming, without deciding, that the trial court erroneously relied on the 1977 amendment, we would not overrule the trial court where it has reached the right result but on mistaken grounds. See In re Trailer and Plumbing Supplies, 133 N.H. 432, 438, 578 A.2d 343, 346 (1990). Accordingly, we affirm.
Affirmed.
Brock, C.J., Batchelder and Thayer, JJ., did not sit; Con-boy, J., superior court justice, sat by special assignment under RSA 490:3; the others concurred.