
32 Kan.App. 2d 106 (2003)
79 P.3d 223
AVIEN CORPORATION, BAGWELL #1 FAMILY LIMITED PARTNERSHIP, DEVORE ENTERPRISES, KNG-CENTRAL, LLC, and SLAWSON EXPLORATION COMPANY, INC., Appellants/Cross-appellees,
v.
FIRST NATIONAL OIL, INC., MICHAEL J. BENNETT, GREG GOLLADAY, and JUDITH L. HOPKINS, Appellees/Cross-appellants.
No. 90,189.
Court of Appeals of Kansas.
Opinion filed November 21, 2003.
*107 J. Scott Pohl and Trevor C. Wohlford, of Hinkle Elkouri Law Firm L.L.C., of Wichita, for appellees/cross-appellants.
Lee Thompson and Deborah A. Petrotta, of Thompson, Stout & Goering, LLC, of Wichita, for appellees/cross-appellants.
Before ELLIOTT, P.J., MALONE, J., and ROGG, S.J.
MALONE, J.:
Avien Corporation, Bagwell #1 Family Limited Partnership, Devore Enterprises, KNG-Central, LLC, and Slawson Exploration Company, Inc. (collectively referred to as Slawson) appeal from the district court's denial of Slawson's motion for summary judgment and the granting of summary judgment to First National Oil, Inc., Michael J. Bennett, Greg Golladay, and Judith L. Hopkins (collectively referred to as First National) on Slawson's petition for declaratory relief. First National cross-appeals from the district court's order granting Slawson summary judgment on First National's counterclaims. The primary issue is whether the district court erred in interpreting a farmout agreement as not allowing multiple assignments of depth intervals after initial completion of a test well. Finding no reversible error, we affirm.
In 1992, Slawson entered into a farmout agreement with First National. The farmout agreement defines the parties' rights as to Section 15-33S-33W in Seward County, Kansas. The farmout agreement provided that First National would assign its operating rights and working interest in the farmed out acreage to Slawson if a producing well was established. However, the assignment was limited to "the productive formation or formations found in the test well."
*108 The farmout agreement required Slawson to commence operations for drilling a test well by August 21, 1992, to be completed with due diligence. Furthermore, the farmout agreement provided that "during the drilling, testing and completion" of the test well, Slawson was required "to make adequate tests to determine if the well is capable of producing oil or gas in economic quantities from the objective formation and from all prospective formations encountered." Additionally, after the initial test well was completed as either a producer or a dry hole, the farmout agreement gave Slawson the exclusive option to commence drilling additional test wells within 180 days.
Slawson drafted the farmout agreement based on forms in its files. The language limiting the assignments to productive formations found in the test well was added by the parties to reflect discussions between Slawson and First National.
Slawson drilled a test well, the Nix #1-15, pursuant to the farmout agreement with First National. The well was completed on October 27, 1992, as an oil well producing from the Chester Sandstone formation. The Chester Sandstone formation was approximately 6,000 feet below the surface.
In a letter dated November 2, 1992, Slawson notified First National of the completed well and requested an assignment pursuant to the farmout agreement. Slawson attached a document titled Assignment of Oil and Gas Leases to the letter. In this document, First National was to assign its working interest in oil and gas leases, but was limited to:
"INSOFAR AND ONLY INSOFAR as said interest covers and applies to the E/2 NE/4 of Section 15-33S-33W, Seward County, Kansas, and further limited to the Chester formation as found in Slawson Nix #1-15, located 1,320' FNL and 660' FEL of Section 15-33S-33W, Seward County, Kansas."
The document did not contain a specific depth limitation.
First National made an assignment using the same document provided by Slawson. However, the assignment was limited to the Chester formation at a depth between "5,836' and 6,146' as shown on the electric log therefrom." Additionally, the assignment was made subject to the farmout agreement. This amended assignment *109 was accepted and recorded by Slawson. Slawson ordered a title opinion after recording the assignment so it would know how, and in what amounts, to pay its investors and those who owned interests in the well.
In August 2000, Slawson learned that a rival company, Anadarko, completed a well in the Marmaton formation approximately 3 miles from the Nix #1-15 well. In a letter dated January 9, 2001, Slawson attempted to assert a right to recomplete in the Marmaton formation within the Nix #1-15 well. Recomplete means to attempt to produce from another formation within the wellbore. Slawson expected to receive an assignment from First National if additional production was established. In a letter dated February 16, 2001, First National notified Slawson it would not allow the recompletion of the Nix #1-15 well.
On January 11, 2002, Slawson filed a petition for declaratory relief with the Sedgwick County District Court. This petition was later amended. In its petition, Slawson sought to have its rights under the farmout agreement interpreted. First National filed an answer to the petition and later filed a counterclaim requesting reassignment of interests Slawson had in the Nix #1-15 well and an accounting from Slawson for amounts of unaccounted-for gas sold or produced from the Nix #1-15 well.
On October 29, 2002, First National filed a motion seeking summary judgment on Slawson's claims for declaratory judgment. On November 20, 2002, Slawson filed a motion seeking summary judgment on its claims as well as First National's counterclaims. The district court granted First National's motion for summary judgment on Slawson's claims and granted Slawson's summary judgment motion on First National's counterclaims. Slawson filed a timely notice of appeal, and First National filed a timely notice of cross-appeal.
"Summary judgment is appropriate when the pleadings, depositions, answers to interrogatories, and admissions on file, together with the affidavits, show that there is no genuine issue as to any material fact and that the moving party is entitled to judgment as a matter of law. The trial court is required to resolve all facts and inferences which may reasonably be drawn from the evidence in favor of the party against whom the ruling is sought. When opposing a motion for *110 summary judgment, an adverse party must come forward with evidence to establish a dispute as to a material fact. In order to preclude summary judgment, the facts subject to the dispute must be material to the conclusive issues in the case. On appeal, we apply the same rules and where we find reasonable minds could differ as to the conclusions drawn from the evidence, summary judgment must be denied. [Citation omitted.]" Bracken v. Dixon Industries, Inc., 272 Kan. 1272, 1274-75, 38 P.3d 679 (2002).
The primary issue in this case involves interpretation of the farmout agreement as to whether it allows multiple assignments of depth intervals within the Nix #1-15 wellbore after initial completion of the test well. The district court found the farmout agreement to be unambiguous and interpreted the agreement in First National's favor as not allowing multiple assignments years after the drilling of the test well. In the alternative, the district court granted summary judgment in favor of First National based upon the statute of limitations and on the ground that the farmout agreement merged with the assignment document. We will first examine the alternative findings of the district court.

Statute of limitations
Slawson claims the district court erred by determining its action was barred by the statute of limitations. Interpretation and application of a statute of limitations is a question of law and is entitled to de novo review. Beltz v. Dings, 27 Kan. App. 2d 507, 510, 6 P.3d 424 (2000).
The parties agree the applicable statute of limitations is 5 years pursuant to K.S.A. 60-511. The issue is determining when the statute of limitations commenced to run.
In Pancake House, Inc. v. Redmond, 239 Kan. 83, 716 P.2d 575 (1986), the court stated:
"In general, a cause of action accrues, so as to start the running of the statute of limitations, as soon as the right to maintain a legal action arises. The true test to determine when an action accrues is that point in time at which the plaintiff could first have filed and prosecuted his action to a successful conclusion. [Citations omitted.]" 239 Kan. at 87.
First National claims that Slawson is now attempting to gain greater rights than were granted in the assignment filed in 1992. Thus, First National claims that Slawson's cause of action arose *111 when First National delivered the assignment to Slawson. However, Slawson's petition for declaratory relief does not request the court to amend the assignment or to interpret the assignment in a way that allows Slawson to have rights to other formations within the Nix #1-15. Instead, Slawson requests the court to determine that the farmout agreement allows Slawson to recomplete the Nix #1-15 wellbore at other formations and gain additional assignments from First National.
This action could not have been commenced until First National refused Slawson's request to recomplete the Nix #1-15 at different formations. First National sent a letter dated February 16, 2001, denying Slawson's request to recomplete the Nix #1-15. Slawson filed its petition for declaratory judgment on January 11, 2002. Therefore, Slawson filed its action within the 5-year statute of limitations.

Merger doctrine
Next, Slawson claims that the district court erred by determining that the merger doctrine prevented Slawson from claiming it has a right to recomplete the Nix #1-15. This issue involves mixed questions of law and fact. The interpretation and effect of legal instruments are questions of law. Unrau v. Kidron Bethel Retirement Services, Inc., 271 Kan. 743, 763, 27 P.3d 1 (2001). However, the merger doctrine is based on the intention of the parties. Blair Constr., Inc. v. McBeth, 273 Kan. 679, 686, 44 P.3d 1244 (2002). Intent is a question of fact to be determined from the written instrument as well as the facts and circumstances surrounding its execution. Blair Constr., Inc., 273 Kan. at 686.
The merger doctrine was explained in Blair Constr., Inc. when the court stated:
"It is a general rule of law applicable to all contracts, including deeds, that prior stipulations and agreements are merged into the final and formal contract or deed executed by the parties. When a deed is delivered and accepted as performance of a contract to convey, the contract is presumed to be merged into the deed. [Citations omitted.]" 273 Kan. at 686.
The district court determined that the farmout agreement merged into the assignment First National made to Slawson after *112 Slawson completed the Nix #1-15. Accordingly, the district court determined that Slawson's drilling rights were limited to the rights granted in the initial assignment.
Here, the evidence does not support the proposition that the parties intended the farmout agreement to merge with the assignment. The assignment document was expressly made subject to the farmout agreement. The purpose of making a document subject to another document is to keep the first document controlling over the second document. Using a plain meaning analysis, it is clear that the parties did not intend the farmout agreement to be merged with the assignment.

Interpretation of the farmout agreement
We return to our central issue, which is whether the district court erred in interpreting the farmout agreement as not allowing multiple assignments of depth intervals within the Nix #1-15 well-bore after initial completion of the test well. Although the district court allowed the parties to present parole evidence on the issue of intent, the district court ultimately concluded that the farmout agreement was unambiguous and should be interpreted based upon the language of the document. The district court interpreted the farmout agreement in First National's favor as not allowing multiple assignments of depth intervals years after the drilling of the test well.
Slawson claims the district court improperly interpreted the farmout agreement. "The interpretation and legal effect of written instruments are matters of law, and an appellate court exercises unlimited review. Regardless of the construction given a written contract by the trial court, an appellate court may construe a written contract and determine its legal effect. [Citation omitted.]" Unrau, 271 Kan. at 763. Additionally, if a written instrument has clear language and can be carried out as written, the rules of construction are not necessary. Decatur County Feed Yard, Inc. v. Fahey, 266 Kan. 999, 1005, 974 P.2d 569 (1999). Whether a written instrument is ambiguous is a matter of law subject to de novo review. Investcorp, L.P. v. Simpson Investment Co., L.C., 267 Kan. 840, 847, 983 P.2d 265 (1999).
*113 Slawson claims that the farmout agreement allowed it to attempt to produce from other geologic formations within the Nix #1-15 wellbore at any time, subject only to its duty to act as a prudent operator. In order to determine whether Slawson's claim has merit, a general understanding of farmout agreements is necessary. A farmout agreement has been defined as
"a transaction where the owner of an oil and gas lease (called the farmor [or assignor]) agrees to an assignment of a part of a lease to one (called the farmee [or assignee]) who agrees, as consideration for the assignment, to drill a well to a certain depth or condition. The farmor normally retains an overriding royalty (a noncost-bearing interest), convertible to a working interest in that part of the lease to be assigned." Hemingway, The Farmout Agreement: A Story Short But Not Always Sweet, 1 Natural Resources and Environment 3 (Spring 1985).
In order to understand the farmout agreement, it is helpful to think of the rights to land three dimensionally. Upon gaining production, Slawson became entitled to an assignment of production rights to a certain area defined both geographically (by surface area) and geologically (by depth). Specifically, upon gaining production of oil, as in the present case, Slawson became entitled geographically to an assignment of the 80-acre tract on which the well is located. Geologically, Slawson was entitled to an assignment of "the productive formation or formations found in the test well." Additionally, it is important to note that the parties agree that Slawson was not entitled to an assignment of rights to potentially productive formations by simple drilling through the formations. Some farmout agreements provide for such rights, but this was not the type of agreement utilized in this case.
Slawson maintains that the district court's interpretation of the farmout agreement placed Slawson in a "catch 22" situation. According to evidence presented at the hearing by First National's own witness, a prudent operator should not commingle production from different formations within a well. Slawson claims that if it initially commingled production from multiple depths within the Nix #1-15 wellbore, then it would have violated its implied duty to act as a prudent operator. Therefore, Slawson claims that it was initially left with the choice of either losing its ability to produce *114 from multiple formations within the Nix #1-15 wellbore or violating its duty as a prudent operator.
Slawson relies on Holly Energy v. Patrick, 239 Kan. 528, 722 P.2d 1073 (1986), in support of a proposition that broadly written farmout agreements should not be construed to limit the parties' development rights absent limiting language within the documents. Holly is distinguishable from the present case because it only deals with geographic and not geologic assignment rights. Furthermore, as First National asserts, the farmout agreement in this case specifically contains limiting language agreed to by the parties.
Here, First National complied with the farmout agreement by assigning Slawson an 80-acre tract geographically and the productive Chester formation geologically. The farmout agreement did not prevent Slawson from acquiring rights to formations other than the one that was initially assigned by First National. Instead, the farmout agreement states:
"Upon completion of the test well as a well capable of producing oil and/or gas in commercial quantities . . . Assignor agrees to assign to Assignee all of Assignor's operating rights and working interest in and to the Lease Acreage as herein defined, limited to the productive formation or formations found in the test well to be located in Section 15-33S-33W, Seward County, Kansas."
Furthermore, the farmout agreement provided that "during the drilling, testing and completion" of the test well, Slawson was required "to make adequate tests to determine if the well is capable of producing oil or gas in economic quantities from the objective formation and from all prospective formations encountered." (Emphasis added.) If Slawson had performed testing and had gained capable production from multiple formations during the drilling and completion of Nix #1-15, First National would have been obligated to assign its rights to those formations as well. However, the farmout agreement does not allow Slawson to attempt to produce from those formations nearly a decade after initially competing the Nix #1-15 wellbore.
The farmout agreement also allowed Slawson to drill option test wells under certain conditions. Specifically, the farmout agreement states in relevant part:

*115 "If the initial test well contemplated by this agreement is completed as either a producer or a dry hole, Assignee shall have the exclusive option for 180 days from completion of the initial test well to commence continuous drilling for additional test wells (called `option test wells') on the Lease Acreage, and the Assignee shall continue to have such exclusive option so long as no more than 180 days shall lapse between completion of one well as either a producer or a dry hole, and commencement of a subsequent well. Completion, as used herein, shall be the date of the release of the completion rig for a well on which a completion attempt is made, and shall be the date of drilling rig release for a well which was a dry hole and on which no completion attempt was made."
Therefore, if Slawson desired to test additional formations, it could have drilled option test wells within 180 days of completing the Nix #1-15.
We agree with the district court that the unambiguous language of the farmout agreement shows that Slawson did not acquire the right to attempt to produce from other formations after the initial completion of the test well. Slawson had the ability to perform testing and determine capable production from multiple formations during the drilling and completion of the test well. Additionally, Slawson could have drilled option test wells to produce from other formations within 180 days of completing the Nix #1-15. The farmout agreement does not give Slawson any rights to other formations beyond these two options.
The district court found the farmout agreement to be unambiguous and did not consider parole evidence in interpreting the agreement. Had the district court considered parole evidence, however, we note there was substantial evidence in the case supporting First National's interpretation of the agreement. A memo written by Slawson's division operation manager on December 29, 2000, indicates that Slawson believed it lost its rights to attempt to produce from other formations within the Nix #1-15 wellbore. In this memo, the division manager claimed that an amendment to the farmout agreement would be necessary to attempt to produce from the Marmaton formation using the Nix #1-15 wellbore. If Slawson was entitled to recomplete the Nix #1-15 under the farmout agreement, then no amendment would be necessary. Additionally, the farmout agreement Slawson entered into with Cudd Petroleum Corporation on a separate tract of land shows that Slawson *116 knew how to draft a farmout agreement that would more readily allow assignment of multiple formations within a wellbore.
In conclusion, the farmout agreement utilized by the parties does not make it simple for Slawson to attain an assignment to multiple formations. However, the agreement is clear and unambiguous and there is no evidence indicating that was not the intent of the parties. Accordingly, the district court did not err in granting First National's motion for summary judgment on Slawson's claims.

Cross-appeal
First National cross-appealed from the district court's grant of summary judgment in favor of Slawson on First National's counterclaims. First National asserted two counterclaims, but only addressed one of these claims on appeal. First National claims that the Nix #1-15 well was not productive and, according to the farmout agreement, First National was entitled to take over the well. As previously indicated, the interpretation and effect of a legal instrument is a question of law. Unrau, 271 Kan. at 763.
First National points to Exhibit 3 of the farmout agreement in support of its argument. This exhibit states in relevant part:
"If any well drilled hereunder is not completed as a producer of oil and/or gas in commercial quantities, and/or [Slawson] proposes to plug and abandon any well drilled hereunder, [Slawson] shall notify [First National] of its intention and [First National] will have 24 hours if a drilling rig is on such location or 30 days if no drilling rig is on such location in which to elect to take over such well and conduct further operations thereon at [First National's] sole cost and expense. . . . In the event [Slawson] has already earned an assignment for such test well, [Slawson] shall reassign such rights pertaining to such test well."
The issue involved interpretation of the term "in commercial quantities" as used in the farmout agreement. The district court determined that Slawson only had to show that the income from the well exceeded the expenses of operating the well from month to month. Slawson was not required to show that the total productivity of the well would be greater than the monthly operating costs, as well as the cost of drilling the well.
Kansas case law has not established a test for determining whether an oil well is producing "in commercial quantities" under *117 a farmout agreement. However, we believe the provision should be interpreted consistently with the phrase "in paying quantities" as used in an oil and gas lease habendum clause. It is generally accepted that the phrase "in paying quantities" as used in an oil and gas lease habendum clause means production of quantities of oil or gas sufficient to yield a profit to the lessee over operating expenses, even though the drilling costs or equipping costs are never recovered, and even though the undertaking as a whole may thus result in a loss to the lessee. Reese Enterprises, Inc. v. Lawson, 220 Kan. 300, 311, 553 P.2d 885 (1976). Under this interpretation, the district court correctly determined the Nix #1-15 was productive.
This case is similar to Texaco, Inc. v. Fox, 228 Kan. 589, 618 P.2d 844 (1980). In Texaco, the court had to determine the meaning of the term "commercial quantities" in a clause reserving mineral rights in a conveyance of land. The court stated that "commercial quantities" as used in a mineral reservation clause has the same meaning as "paying quantities" as used in a habendum clause of an oil and gas lease. 228 Kan. at 592.
Here, if Slawson did not continue to produce from the Nix #1-15 in "commercial quantities," then First National would have the right to take over the well. We agree with the district court that Slawson must only show that the Nix #1-15 was gaining a profit over its monthly operating expenses. First National does not claim that under this reasoning the well was not sufficiently productive. Accordingly, the district court did not err by granting Slawson summary judgment on First National's counterclaim.
Affirmed.
