
948 P.2d 250 (1997)
Edward C. PETERS, Plaintiff and Respondent,
v.
STATE of Montana, Defendant and Appellant.
No. 96-657.
Supreme Court of Montana.
Submitted on Briefs May 22, 1997.
Decided November 7, 1997.
*251 Michael T. McCabe, Lieutenant Colonel, MTARNG, Helena, for Defendant and Appellant.
Lawrence A. Anderson, Great Falls, for Plaintiff and Respondent.
Kelly A. Jenkins, PERD, Helena, for Amicus Curiae.
HUNT, Justice.
Defendant, State of Montana (State), appeals from an order of the Eighth Judicial District Court, Cascade County, granting Plaintiff's Motion To Enforce Judgment. We affirm.
We state the issues on appeal as follows:
1. Did the District Court err in ruling that the State's set-off claim was barred as a compulsory counterclaim under Rule 13(a), M.R.Civ.P.?
2. Did the District Court err in finding that the State's Department of Military Affairs (DMA) and its Public Employees' Retirement System (PERS) were the same party for purposes of this action?
3. Did the District Court err when it ordered the State to pay Peters his full settlement as written in the parties' Consent Judgment, without any set-off for PERS claims?

BACKGROUND
This case is the latest in a series of disputes between the firefighters employed by the Montana Air National Guard (Guard) in Great Falls, Montana, and the State of Montana. From 1974 until his termination in 1990, the respondent in this case, Edward C. Peters (Peters), worked as a firefighter for the Guard. During this time, the firefighters twice sued the State for unpaid overtime, and prevailed on both actions. See Stimac v. State (1991), 248 Mont. 412, 812 P.2d 1246 (settlement reached); and Tefft v. State (1995), 271 Mont. 82, 894 P.2d 317 (holding that under the federal Fair Labor Standards Act (FLSA), the State was required to pay the firefighters for overtime at the overtime rate). To circumvent its obligation to pay the firefighters overtime in the future, the DMA sought an exemption from the State's pay matrix under § 2-18-103(6), MCA, which excludes members of the militia. See Tefft, 894 P.2d at 321. The State granted the exemption, and classified the firefighters as "Militia Protective Services." Thereafter, in order to qualify for the exemption, the DMA made membership in the Guard a condition of employment for firefighters.
Joseph M. McKamey, a fellow firefighter of Peters, then filed suit against the State alleging that the DMA's policy, making membership in the Guard a condition of employment, violated the Equal Protection Clause of the Montana and United States Constitutions. See McKamey v. State (1994), 268 Mont. 137, 885 P.2d 515.
On December 31, 1990, during the pendency of the Tefft and McKamey decisions, the DMA fired Peters because he was no longer a member of the Guard. On January 1, 1991, Peters began drawing retirement benefits from his pension with the State's PERS. On November 5, 1991, Peters filed suit against the State alleging the same claim as that in McKamey, that the DMA's policy, requiring firefighters to be members of the Guard, was discriminatory. Peters' complaint sought the following relief: reinstatement of his employment; lost wages and *252 employment benefits for the period of termination; liquidated damages under the provisions of the FLSA; and attorney's fees and costs.
On December 8, 1993, the district court decided Tefft in favor of the firefighters. In awarding the firefighters their overtime pay, the court held that the DMA's exemption from the state pay matrix was a "blatant subterfuge" created in bad faith to avoid paying the firefighters overtime under the provisions of the FLSA. On February 4, 1994, the district court decided McKamey, also in favor of the firefighter. The district court held that the DMA's policy, mandatory membership in the Guard as a condition of employment, was unconstitutional as it violated equal protection standards under the Montana and United States Constitutions. We affirmed both cases on appeal. See Tefft, 894 P.2d at 323; McKamey, 885 P.2d at 522.
Based on the Tefft and McKamey decisions, on December 21, 1994, the District Court granted Peters' motion for partial summary judgment on the issue of liability. The parties then settled on the amount of damages. On March 9, 1995, the District Court entered a Consent Judgment which provided Peters the following:
1. Reinstatement to his employment as if not terminated;
2. Lost wages of $82,171;
3. Lost annual leave and sick leave benefits;
4. PERS contributions that the DMA would have made had Peters not been terminated; and
5. Attorney's fees and costs of suit.
Representatives from the DMA and the PERS met to compute the amount of PERS contributions the DMA was to make toward Peters' pension. At that time, PERS informed the DMA that Peters was retired and that he had been collecting retirement benefits since January of 1991. PERS informed the DMA that because Peters would be reinstated to his employment as if never fired, DMA would have to reimburse PERS for the amount of retirement benefits Peters had collected, from the time he was fired until his reinstatement, plus the amount of PERS assessments which would have been deducted from Peters' regular paychecks had he not been fired, a total sum of $35,970.46. The PERS reasoned that Peters could not be retired and employed at the same time. PERS suggested that the DMA raise this money by deducting it from Peters' settlement fund. The DMA took PERS's suggestion and, after explaining the situation to Peters, demanded that his damage award be offset by $35,970.46. The DMA then paid $100,000 into escrow pending Peters' assent to these terms.
Meanwhile, Peters had elected to stay retired rather than be reinstated in his employment. PERS refused to make any further retirement payments to Peters until it received reimbursement for the $35,970.46, either from the DMA or from Peters.
Peters then filed a Motion To Enforce Judgment on May 10, 1996. On June 18, 1996, the District Court held a hearing on the motion, and on September 20, 1996, the District Court entered its Memorandum and Order in favor of Peters. The District Court ruled that the State's set-off claim was barred as a compulsory counterclaim under Rule 13(a) M.R.Civ.P.; that both the DMA and the PERS were bound to the Consent Judgment because they were the same party, collectively known as "State of Montana;" and that the State was required to pay Peters his full settlement as written in the parties' Consent Judgment, without any set-off for PERS retirement benefits already received. The State appeals this ruling. The DMA has appeared for the State, and the PERS has filed an amicus curiae brief with the Court.

DISCUSSION
The standard of review of a district court's conclusions of law is whether the court's interpretation of the law is correct. Welch v. Huber (1993), 262 Mont. 114, 116, 862 P.2d 1180, 1181.

Issue 1
Did the District Court err in ruling that the State's set-off claim was barred as a *253 compulsory counterclaim under Rule 13(a), M.R.Civ.P.?
Rule 13(a), M.R.Civ.P., provides in pertinent part:
A pleading shall state as a counterclaim any claim which at the time of serving the pleading the pleader has against any opposing party, if it arises out of the transaction or occurrence that is the subject matter of the opposing party's claim....
The purpose of Rule 13(a) is "to bring all logically related claims into a single litigation, thereby avoiding a multiplicity of suits." Julian v. Mattson (1985), 219 Mont. 145, 148, 710 P.2d 707, 709. Our analysis of whether the District Court correctly applied Rule 13(a) depends first, on what exactly comprises the "transaction or occurrence" in this case, and second, on whether the State's set-off claim arose out of this transaction or occurrence.
In determining what constitutes the "transaction" in this case, the State urges this Court to go back to the days of code pleading and apply the narrowest of interpretations to the term. The State cites Kaufman v. Cooper (1909), 39 Mont. 146, 155-56, 101 P. 969, 972, for the rule that a transaction is comprised of only that which appears affirmatively in the complaint. Under the rule of Kaufman, the State argues that the transaction in the instant case is only what appears on Peters' complaint; the anti-discrimination claim and damages. The State argues that because Peters failed to specifically plead for retention of his retirement benefits as part of the damage award, the State's set-off claim for recoupment of these benefits falls outside the litigated transaction.
We disagree with the State's interpretation of "transaction." Kaufman is inapposite as that case interpreted §§ 6540, 6541, and 6547 of the Revised Codes of Montana. These code sections are superseded by Rule 13(a), M.R.Civ.P., adopted by the Montana Legislature in 1961. Since the adoption of Rule 13(a), we have consistently applied a broader interpretation of the term "transaction."
In Julian, we defined "transaction" as:
that combination of acts and events, circumstances and defaults, which, viewed in one aspect, results in the plaintiff's right of action, and viewed in another aspect, results in the defendant's right of action, and it applies to any dealings of the parties resulting in wrong, without regard to whether the wrong be done by violence, neglect or breach of contract.
Julian, 710 P.2d at 710 (citations omitted).
Similarly, in First Bank v. Fourth Judicial Dist. Court (1987), 226 Mont. 515, 737 P.2d 1132, 1136, we adopted the United States Supreme Court's logical relationship test in interpreting "transaction:"
`Transaction' is a word of flexible meaning. It may comprehend a series of many occurrence, depending not so much upon the immediateness of their connection, as upon their logical relationship.... It is the one circumstance without which neither party would have found it necessary to seek relief. Essential facts alleged by appellant... constitute in part the cause of action set forth in the counterclaim. That they are not precisely identical, or that the counterclaim embraces additional allegations... does not matter.
First Bank, 737 P.2d at 1136 (citing Moore v. New York Cotton Exchange (1926), 270 U.S. 593, 610, 46 S.Ct. 367, 371, 70 L.Ed. 750, 757). In First Bank, we held that belated claims of creditor misconduct were barred as compulsory counterclaims because they arose out of the transaction involving the bank's foreclosure suit. First Bank, 737 P.2d at 1136. In reaching our conclusion, we reasoned that "the factual history of the complaint is the same as the history alluded to in the [belated claims]" and that there was a "logical relationship" between the bank's foreclosure complaint and the claims of creditor misconduct. First Bank, 737 P.2d at 1136.
In Turtainen v. Poulsen (1990), 243 Mont. 355, 792 P.2d 1089, we expressed the logical relationship test in terms of whether the belated claim "arose out of the same aggregate of operative facts" that gave rise to the underlying claim. Turtainen, 792 P.2d at 1091. In that case, we held that belated claims for fraud and enforcement of restrictive *254 covenants "arose out of the same aggregate of operative facts, the creation and execution of the contract for sale of land...." Turtainen, 792 P.2d at 1091.
Applying the logical relationship test to the instant case, we determine that the State's set-off claim against Peters arose out of the same transaction as Peters' FLSA claim against the State. The underlying "transaction" in both cases is the unlawful termination of Peters' employment and the damages resulting therefrom. We agree with Peters that the unlawful termination of his employment set in motion all the events resulting both in his FLSA claim and the State's set-off claim. The claims are logically related because they arose out of the same aggregate of operative facts.
Amicus argues that we need not reach the "same transaction" analysis, because the facts giving rise to the State's set-off claim did not exist "at the time of pleading" as required by Rule 13(a). Amicus cites a federal case, Burlington Northern R.R. Co. v. Strong (7th Cir.1990), 907 F.2d 707, for the rule that a claim is not a compulsory counterclaim if it did not exist until the conclusion of the first suit. Strong, 907 F.2d at 712. Although Amicus is silent as to which facts did not exist at the time of pleading, it appears that Amicus is referring to the fact that the DMA did not know of Peters' retirement status until after signing the Consent Judgment. That argument is unpersuasive. The existence of a fact and a party's knowledge of that fact are two different things. Peters' retirement status was a fact that existed at the time of pleading. That the DMA had no knowledge of that fact is of no consequence here. Indeed, we see no reason why the DMA's investigation and discovery did not reveal the fact of Peters' retirement status.
Both the State and Amicus make much of the equities of the parties resulting from the District Court's enforcement order. The State and Amicus argue that it is fundamentally unfair for Peters to receive both retirement benefits and PERS contributions for the same time period; that Peters, by definition, cannot be "retired" and an "active member" at the same time. We emphasize that the issue presented, whether Rule 13(a) bars the State's set-off claim, is strictly procedural. Our holding does not address the merits of whether Peters is entitled to both retirement benefits and PERS contributions for the same period. Likewise, our holding does not address the merits of from whom PERS is to receive reimbursement for the depletion of its trust fund. Those questions are not part of this action.
Having determined that the State's set-off claim arose out of the same transaction as Peters' claim, and given the policy of judicial economy underlying Rule 13(a), we conclude that the District Court did not err in ruling that the State's set-off claim was barred as a compulsory counterclaim under Rule 13(a).

Issue 2
Did the District Court err in finding that the DMA and the PERS were the same party for purposes of this action?
In its Order of September 20, 1996, enforcing the parties' Consent Judgment, the District Court stated the following:
[N]either PERS or DMA want to bear the financial consequences (lost pension assessments and premature pension payout) caused when Plaintiff was wrongfully fired. Instead of resolving this dispute between themselves, the agencies seek to pass their expense along to the Plaintiff. They do this by treating PERS as an independent party....
The State of Montana (not just DMA) is the Defendant and the judgment obligor in this case. Both PERS and DMA are state agencies, and accordingly are bound by the State's position . [citations omitted] DMA and PERS are one party for the purposes of this lawsuit. The fact that the $36,000 recoupment claim originated with PERS and not with DMA makes no difference in assessing whether [the set-off] claim is barred....
In concluding that PERS and DMA were one party, the District Court relied upon a United States Supreme Court case wherein the Court held that because privity exists between agents of the same government, a judgment against one agent is binding on the others. Sunshine Anthracite Coal Co. v. *255 Adkins (1940), 310 U.S. 381, 402-403, 60 S.Ct. 907, 917, 84 L.Ed. 1263, 1276.
The State argues that the District Court erred when it concluded that DMA and PERS were one party. As support for its argument, the State cites two companion cases where this Court recognized the separateness of state agencies for purposes of suing one another. See Board of Regents v. Judge (1975), 168 Mont. 433, 543 P.2d 1323; State ex rel. Judge v. Legislative Fin. Comm. (1975), 168 Mont. 470, 543 P.2d 1317. Likewise, Amicus assigns error to the court's conclusion, arguing that it ignores the constitutionally imposed fiduciary duty of the PERS Board not to encumber, divert, or reduce the pension trust assets. See Art. VIII, Sec. 15, Mont. Const.
Both arguments are without merit. The cases cited by the State do not apply in the instant case because PERS and DMA are not suing one another. Rather, the two agencies are trying to recoup Peters' retirement benefits from Peters. The District Court's reliance on Sunshine Anthracite Coal Co. was proper. The State was the named Defendant on all the pleadings and the named party to the Consent Judgment. Thus, the judgment against the State is binding on the PERS and the DMA. Similarly, Amicus' contention is without merit because there is nothing in the District Court's order requiring the PERS Board to deplete the pension trust assets. The effect of the court's order was not that the PERS will not be reimbursed the $35,970.46. Rather, the effect of the court's order was simply that reimbursement of the sum must come from someone other than Peters. Upon the foregoing, we hold the District Court did not err in concluding that PERS and DMA were one party.

Issue 3
Did the District Court err when it ordered the State to pay Peters his full settlement as written in the parties' Consent Judgment, without any set-off for PERS claims?
The State argues that the District Court's enforcement order improperly amended the Consent Judgment. Specifically, the State contends that by refusing its $35,970.46 set-off claim, the District Court added new relief not contained in the terms of the Consent Judgment, and substantially altered the rights of the parties as originally determined. The State relies on State ex rel. Vaughn v. District Court (1941), 111 Mont. 552, 111 P.2d 810, for the rule that a court may amend or modify a judgment to remedy an error or to clarify an ambiguity, but a court is without jurisdiction to substantially alter the rights of parties as originally determined. Vaughn, 111 P.2d at 811.
The State also argues that the District Court's enforcement order violated Montana's parol evidence rule, § 28-2-905, MCA, which states in relevant part:
Whenever the terms of an agreement have been reduced to writing . . . it is to be considered as containing all those terms. Therefore, there can be . . . no evidence of the terms of the agreement other than the contents of the writing . . . .
The State argues that the District Court violated this rule by imposing on the State the "additional" obligation of paying Peters' retirement benefits.
Peters argues that the parol evidence rule is precisely the reason why the court's enforcement order is not in error. Peters contends that the court followed the parol evidence rule by refusing to make the State's belated set-off claim part of the original Consent Judgment. Peters also argues that in strictly construing the terms of the Consent Judgment as written, the court followed general principles of contract law. See Hohensee v. Chemodurow (1970), 155 Mont. 288, 293, 470 P.2d 965, 967 ("It is not the province of courts to make contracts for parties suijuris, but rather to interpret and enforce them . . . in accordance with their terms.") (citation omitted).
We agree with Peters. The State's argument that the District Court amended the original judgment is without merit. In ordering the State to pay Peters all of his pension benefits "as if he were not terminated," the District Court simply followed basic principles of contract law by enforcing the terms of the original Consent Judgment as written. In ordering that the State's set-off *256 claim was barred by Rule 13(a), the District Court complied with the parol evidence rule by refusing to consider a term not contemplated in the original Consent Judgment. We conclude that the District Court did not err when it ordered the State to pay Peters his full settlement without any set-off for PERS claims.
Upon the foregoing, the District Court's enforcement order is affirmed.
TRIEWEILER, NELSON, REGNIER and GRAY, JJ., concur.
