
605 N.W.2d 161 (2000)
2000 ND 14
Gloria AHO, Beverly J. Hamel, Darlene Aliff, Plaintiffs and Appellants, and
Bradley K. Aho, Plaintiff,
v.
Alex MARAGOS and his heirs, executors, administrators, successors and assigns, and all other persons unknown or their heirs, devisees, legatees or creditors or otherwise claiming any estate or interest in, or lien or encumbrance upon, the property described in the Complaint, herein, Defendants and Appellees, and
Gloria Maragos, Defendant.
No. 990153.
Supreme Court of North Dakota.
January 21, 2000.
*162 Scott J. McDonald, McDonald Law Office, Bowman, N.D. for plaintiffs and appellants.
John C. Skowronek, Lamont & Skowronek, Minot, N.D., for defendant and appellee. Submitted on brief.
MARING, Justice.
[¶ 1] Gloria Aho, Beverly J. Hamel, and Darlene Aliff appeal from a district court judgment quieting title in certain minerals in them, but ordering them to execute an oil and gas lease in favor of Alex Maragos. We affirm.

I
[¶ 2] This is the fourth appeal involving litigation of the various claims to the mineral interests underlying certain land in Bottineau County. See Maragos v. Union Oil Co. of California, 1998 ND 180, 584 N.W.2d 850; Aho v. Maragos, 1998 ND 107, 579 N.W.2d 165; Maragos v. Norwest Bank Minnesota, N.A., 507 N.W.2d 562 (N.D.1993). Edwin and Mildred Feland owned the land in question and, in 1984, named Maragos their agent to clear title to the property. In 1988, the Felands granted an oil and gas lease with a three-year primary term to Maragos.
[¶ 3] Maragos was unable to develop the lease due to claims on the minerals by Norwest Bank ("Norwest"), Flore Properties ("Flore"), and Union Oil of California ("Unocal"). In 1990, Maragos sued Norwest, Flore, and Unocal to quiet title to the mineral interests. Maragos also asserted claims for slander of title, bad faith, and abuse of process, seeking monetary damages, actual costs, and attorney fees. Upon motion of Norwest and Flore, the Felands were named as involuntary plaintiffs in the action. Mildred died while the action was pending, and Edwin received her interest in the property. Maragos's three-year lease expired in 1991 while the litigation was pending.
[¶ 4] Following an appeal to this Court, see Maragos v. Norwest, 507 N.W.2d 562, Maragos, Edwin, Norwest, and Flore settled the action, stipulating to quiet title in the minerals in Edwin and Maragos and to dismiss all remaining claims.[1] Edwin died shortly thereafter, and his interest in the minerals passed to his daughters, Aho, Hamel, and Aliff ("the heirs").
[¶ 5] Maragos claims he had an oral agreement with Edwin that, when the Norwest litigation was concluded, Edwin would lease the minerals to Maragos. The heirs refused to honor this alleged oral agreement and brought this action to quiet title to the minerals in 1997. We reversed a summary judgment in favor of the heirs, *163 see Aho, 1998 ND 107, 579 N.W.2d 165, and a bench trial was held on December 15, 1998. The trial court quieted title in the minerals in the heirs, but ordered them to execute an oil and gas lease to Maragos in the same form as the 1988 written lease. The heirs have appealed.

II
[¶ 6] The heirs assert the court erred in ordering them to execute a lease to Maragos because Maragos did not file a counterclaim seeking such relief. Maragos's answer did not specifically mention the oral agreement for a lease, but generally alleged he had an interest in the property. The heirs argue the alleged oral agreement for a lease should have been raised through a compulsory counterclaim under N.D.R.Civ.P. 13(a).
[¶ 7] We find it unnecessary to determine whether this claim was adequately pleaded or falls within the compulsory counterclaim provisions of N.D.R.Civ.P. 13(a) because we conclude it was tried by consent of the parties. Rule 15(b), N.D.R.Civ.P., states:
If issues not raised by the pleadings are tried by express or implied consent of the parties, they shall be treated in all respects as if they had been raised in the pleadings. Such amendment of the pleadings as may be necessary to cause them to conform to the evidence and to raise these issues may be made upon motion of any party at any time, even after judgment; but failure so to amend does not affect the result of the trial of those issues.
See also Schumacher v. Schumacher, 1999 ND 149, ¶ 25, 598 N.W.2d 131; Check Control, Inc. v. Shepherd, 462 N.W.2d 644, 648 (N.D.1990). The rule applies even if the issue is one which should have been raised in a compulsory counterclaim. See Check Control, at 648; Harrington v. Harrington, 365 N.W.2d 552, 557 (N.D.1985). A pleading may be amended impliedly by the introduction of evidence which varies the theory of the case and which is not objected to by the opposing party on the grounds that it is not within the issues in the pleadings. N.D.R.Civ.P. 15(b); Schumacher, at ¶ 25.
[¶ 8] The heirs assert the "implied amendment" rule should not apply because "Maragos never claimed, at any time in trial or in his pleadings, that he was entitled to a second Oil and Gas Lease." This assertion is belied by the record in this case. This issue had been injected into the case before the first appeal. Our opinion in the first appeal states: "Maragos claims he had an oral agreement with Edwin Feland that, as soon as the Norwest litigation was concluded, Feland would lease the minerals to Maragos." Aho, 1998 ND 107, ¶ 3, 579 N.W.2d 165. At trial, Maragos testified he and Edwin agreed Maragos would receive a lease when the Norwest litigation settled. The heirs did not object to this testimony as being beyond the scope of the pleadings. Accordingly, the lease issue was tried by the implied consent of the parties, and the pleadings were impliedly amended under N.D.R.Civ.P. 15(b) to conform to the evidence.

III
[¶ 9] The heirs assert there was no additional consideration given for a new oil and gas lease, and thus any oral agreement for such a lease should not be enforced. The heirs argue there was an original agreement between the Felands and Maragos that he would receive a three-year lease in exchange for his work clearing title to the minerals. The heirs claim the Felands fully performed their obligations to Maragos by executing the 1988 written lease. See N.D.C.C. § 9-12-01.
[¶ 10] The existence of consideration is a question of law, fully reviewable by this Court. Reed v. University of North Dakota, 1999 ND 25, ¶ 19, 589 N.W.2d 880; Habeck v. MacDonald, 520 N.W.2d 808, 810 (N.D.1994). Consideration may include any benefit to the promissor *164 or detriment to the promissee. N.D.C.C. § 9-05-01; Reed, at ¶ 19; Habeck, at 810. Refraining from doing something that one has a legal right to do constitutes good consideration, regardless of the value of that right to the other party. Habeck, at 811; Maragos v. Norwest, 507 N.W.2d at 565.
[¶ 11] Maragos testified that the oral agreement for a new lease arose during negotiations to settle the quiet title action against Norwest and Flore. Specifically, Maragos testified he would not have agreed to the settlement, which dismissed his claims for damages against Norwest and Flore, without Edwin Feland's assurance he could recoup his losses and expenses through an extension of the expired written lease:
Q. Mr. Maragos, could there have been a stipulation settling this quiet title matter without your agreement?
A. No.
Q. Okay. And would you have agreed to settle this quiet title action if you were going to get nothing for your 10 years of work quieting title on this property?
A. No.
Q. So did you have some sort of reasonable expectation that you were going to get compensated for all the work you did when you finally got this quieted?
A. Yes.
....
Q. MyI believe the question, Mr. Maragos, was: What was your agreement with Ed Feland as to the entry of judgment in this quiet title action?
A. Well, I was dead set against settling with Norwest Bank, because we had initiallywe had gotten a reversal. And everything that I had said turned out to be correct. Ed himself and his immediate family were quite adamant they wanted the settlement.
....
THE WITNESS: I had to have some way of assuring me that I would get something out of this action. I was the one that initiated it, I was the one that spent all the money at thisup to this point. I had carried the action. I filed the action. I was the one that had the lease that was now expired.
So when I sat down with that, I explained to him that I can'tyou know, I can't just walk away from the estate now. I've got too much invested. And he agreed. And I said that I need some kind of assurance that I can go ahead and develop that lease, find somebody to drill it, and get my interest. And if I just sign off on this without having some kind of security toward that purpose, then I said I end up with nothing.
And so we agreed that I would take an interest in the mineralsand this was an agreement between Ed and I. Ed trusted me, and I trusted him. But that I would take an interest in the minerals. When we got everything all settled out, I would have time to go out and renegotiate a drilling commitment and a new lease. And that was our agreement.
Q. So was it your agreement that judgment be entered in accordance with the judgment that's reflected on Defendant's Exhibit A?
A. That was exactly what we agreed to.
[¶ 12] The trial court found there was an agreement Maragos would receive "the same type of lease as he received in 1988" when title was cleared by the signing of the settlement agreement. The court therefore ordered the heirs to execute a lease to Maragos in the same form as the 1988 lease.
[¶ 13] Forbearance from initiating or continuing a lawsuit may constitute good consideration. Maragos's signing of the stipulation, which dismissed his claims for damages against Norwest and Flore, constituted valid consideration for the lease. Maragos v. Norwest, 507 N.W.2d at 565; Farmers Union Oil Co. v. Maixner, 376 N.W.2d 43, 46 (N.D.1985).


*165 IV
[¶ 14] The judgment is affirmed.
[¶ 15] GERALD W. VANDE WALLE, C.J., CAROL RONNING KAPSNER, DALE V. SANDSTROM, MAURICE R. HUNKE, D.J., concur.
[¶ 16] MAURICE R. HUNKE, D. J., sitting in place of NEUMANN, J., disqualified.
NOTES
[1]  Unocal had disclaimed all interest in the minerals. Maragos's remaining claims against Unocal were dismissed after a trial, and we affirmed that judgment. See Maragos v. Union Oil, 1998 ND 180, 584 N.W.2d 850.
