
184 P.3d 943 (2008)
CARROTHERS CONSTRUCTION COMPANY, L.L.C., Appellant,
v.
CITY OF SOUTH HUTCHINSON, Kansas, Appellee.
No. 98,023.
Court of Appeals of Kansas.
May 23, 2008.
*945 Stephen R. Miller and Richard W. Miller, of Miller Law Firm, P.C., of Kansas City, Missouri, for appellant.
Michael J. Norton and James D. Oliver, of Foulston Siefkin LLP, of Wichita, for appellee.
Before BUSER, P.J., MALONE and McANANY, JJ.
MALONE, J.
Carrothers Construction Company, L.L.C. (Carrothers) appeals the district court's decision granting summary judgment and awarding liquidated damages in favor of the City of South Hutchinson (City). Carrothers entered into a contract with the City to construct a wastewater treatment facility, and Carrothers failed to complete the project by *946 the deadlines set forth in the contract, triggering the liquidated damages provision. The only issue is whether the district court erred in finding the liquidated damages provision of the contract was enforceable.
On March 12, 2002, Carrothers executed a contract with the City to construct a wastewater treatment facility for $5,618,000. The contract provided Carrothers should reach substantial completion of the project by July 15, 2003, and final completion by August 14, 2003. The engineering company hired by the City, MKEC Engineering Consultants, Inc. (MKEC), assisted in drafting the contract, which included a "time is of the essence" clause and a provision for liquidated damages. An MKEC employee, David Chase, performed the calculations for the liquidated damages provision. MKEC's manager of environmental engineering, Lynn Moore, discussed the calculations with Chase and approved the provision.
MKEC considered several factors in determining prospective liquidated damages caused by delay in the completion of the work, including: the City's cost to monitor the project; additional labor costs for city employees, environmental department staff, structural and electrical staff, and controls department staff; additional use of utilities; the cost of engaging another consultant; legal expenses; renting equipment to address flow situations; action by the Kansas Department of Health & Environment (KDHE) if the treatment plant was not operating within permit limits at the time construction should be finished; and other unknowns in the event the project was not completed on time. MKEC set the amount of liquidated damages for failure to meet both the substantial completion deadline and the final completion deadline at $850 per day.
Carrothers timely commenced work on the project. Pursuant to change orders allowed by the contract, Carrothers and the City agreed to delay the substantial and final completion deadlines to July 26, 2003, and August 25, 2003, respectively. Carrothers did not achieve substantial completion by July 26, 2003. By November 10, 2003, the City shut down the old plant and switched its operations to the new plant even though the new plant was not completely operational and the computerized control system was not complete. Moore informed Carrothers in December 2003 that to attain substantial completion Carrothers "needed to have all the equipment in place, the structures and piping done, everything operational, tested, [and] approved." Moore also informed Carrothers that the control system must be operational, and the safety features must be in place for the protection of the operators.
MKEC determined Carrothers reached substantial completion on January 12, 2004, based on completion of the control system and the safety features. From start-up of the new plant in November through the time the engineer declared substantial completion in January, operators ran the facility manually even though the safety features were not completed. Carrothers delivered the operating manuals for the computerized control system on January 13, 2004. Upon receipt of the operating manuals, MKEC determined Carrothers had achieved final completion.
On February 16, 2004, Carrothers submitted a final payment application for its work on the project. On February 17, 2004, MKEC presented Carrothers' request for final payment to the City and recommended the City withhold $145,350 in liquidated damages. There were 170 days from July 26, 2003, the revised substantial completion deadline, to January 12, 2004, the date MKEC determined Carrothers had substantially completed the project. There was 1 additional day until the project was finally completed on January 13, 2004, for a total of 171 days that the project was delayed. Multiplying 171 days by $850 per day equals $145,350, the amount MKEC determined as liquidated damages. The City accepted MKEC's recommendation and withheld the liquidated damages.
On January 3, 2005, Carrothers filed a petition in the district court against the City. In the petition, Carrothers alleged the City breached its contract by improperly withholding $145,350 from the City's last payment to Carrothers. Carrothers also requested a declaratory judgment concerning the enforceability and reasonableness of the liquidated damages provision. The City filed *947 a counterclaim and alleged Carrothers breached the contract by failing to timely complete the project.
The City filed a motion for summary judgment on February 27, 2006. In its motion, the City argued Carrothers had failed to sustain its burden of proving the liquidated damages clause constituted an unenforceable penalty. According to the City, the provision was reasonable based upon the facts available to the parties at the time they executed the contract. The City also argued that liquidated damages were difficult to ascertain in this case due to the scope of the project. Carrothers filed a cross-motion for summary judgment. Carrothers argued the liquidated damages provision constituted a penalty to secure performance and did not have any relation to actual damages, which rendered the provision unenforceable under Kansas law.
On April 13, 2006, the district court granted summary judgment in favor of the City, finding the contract was unambiguous and the amount of liquidated damages was reasonable in relation to the potential injuries suffered by the City as a result of the delays in completing the wastewater treatment facility. Carrothers filed a motion to reconsider, which the district court denied. Carrothers timely appeals.
Carrothers asserts two related claims concerning the liquidated damages provision of the contract. First, Carrothers argues that a provision that permits recovery of liquidated damages after a project is substantially completed is unconscionable, unreasonable, and unenforceable. Second, Carrothers contends the liquidated damages provision in the contract with the City constituted a penalty. Because penalty provisions are unenforceable under Kansas law, Carrothers argues the district court erred in enforcing the liquidated damages provision of the contract and granting summary judgment in favor of the City.
The standard of appellate review of a district court's decision granting summary judgment is well known:
"`"`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 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.' [Citations omitted.]"'" Korytkowski v. City of Ottawa, 283 Kan. 122, 128, 152 P.3d 53 (2007).
Furthermore, the propriety of liquidated damages is a question of law over which this court's review is unlimited. IPC Retail Properties v. Oriental Gardens, Inc., 32 Kan. App.2d 554, 561, 86 P.3d 543 (2004).
The interpretation and legal effect of written instruments are matters of law. Unrau v. Kidron Bethel Retirement Services, Inc., 271 Kan. 743, 763, 27 P.3d 1 (2001). The primary rule for interpreting written contracts is to ascertain the parties' intent. If the terms of the contract are clear, the intent of the parties is to be determined from the language of the contract without applying rules of construction. Anderson v. Dillard's Inc., 283 Kan. 432, 436, 153 P.3d 550 (2007). The interpretation of a written contract that is free from ambiguity is a judicial function and does not require oral testimony to determine the contract's meaning. An ambiguity in a contract does not appear until two or more meanings can be construed from the contract provisions. Gore v. Beren, 254 Kan. 418, 426-27, 867 P.2d 330 (1994).

Liquidated damages incurred after substantial completion
Carrothers first claims that a liquidated damages provision is unenforceable *948 once the performing party has substantially completed the contract work. Carrothers cites several cases to demonstrate that a liquidated damages provision is unenforceable when the performing party has substantially completed the project and the liquidated damages assessed are a penalty rather than a measure of actual damages. See, e.g., Perini Corp. v. Greate Bay Hotel & Casino, Inc., 129 N.J. 479, 610 A.2d 364 (1992). Carrothers argues that once the City took possession of the new facility and obtained beneficial use of the property, the City could no longer recover liquidated damages from Carrothers.
The City does not dispute the legal principle that a liquidated damages provision is unenforceable when the provision constitutes a penalty. However, the City argues that Carrothers' work under the contract was not substantially completed until January 12, 2004. Thus, according the City, the real issues for the district court to determine were (1) what constituted substantial completion under the contract, and (2) when did substantial completion occur.
Here, at least three contract provisions relate to when substantial completion occurred and the effect of substantial completion on liquidated damages. Section 3.3 of the contract, labeled "Liquidated Damages," provides:
"OWNER and CONTRACTOR recognize that time is of the essence of this Agreement and that OWNER will suffer financial loss if the Work is not started and completed within the times specified in paragraphs 3.1 and 3.2 above, plus any extensions thereof allowed in accordance with Article 12 of the General Conditions. They also recognize the delays, expense and difficulties involved in proving the actual loss suffered by OWNER if the Work is not completed on time. Accordingly, instead of requiring any such proof, OWNER and CONTRACTOR agree that as liquidated damages for delay (but not as a penalty) CONTRACTOR shall pay OWNER Six Hundred Dollars ($600.00) for each day that expires after the time specified in paragraph 3.1 for the work to start, and Eight Hundred Fifty Dollars ($850.00) for each day that expires after the time specified in paragraph 3.2 for Substantial Completion until the Work is substantially complete. After Substantial Completion, if CONTRACTOR shall neglect, refuse or fail to complete the remaining Work within the time specified in paragraph 3.2 for completion and readiness for final payment or any proper extension thereof granted by OWNER, CONTRACTOR shall pay OWNER Eight Hundred Fifty Dollars ($850.00) for each day that expires after the time specified in paragraph 3.1 for completion and readiness for final payment."
The contract defines "Work" in Article 1:
"Construct wastewater treatment liquid process facilities to replace the existing liquid process facilities. Construct a maintenance building, site piping, other site utilities, site grading, and system controls. Drain, clean existing basins for future use and remove obsolete equipment. The capacity of the new process facilities will be 2 MGD. A new computer based control system for the improvements is included in the Work."
The contract documents define "substantial completion" as:
"The time at which the Work (or a specified part thereof) has progressed to the point where, in the opinion of ENGINEER, the Work (or a specified part thereof) is sufficiently complete, in accordance with the Contract Documents, so that the Work (or a specified part thereof) can be utilized for the purposes for which it is intended."
Pursuant to the contract provisions, MKEC determined substantial completion occurred on January 12, 2004, when the computerized control system and the safety features were completed, and final completion occurred on January 13, 2004, when Carrothers delivered the operating manuals for the control system. Accordingly, the district court found the date of substantial completion was January 12, 2004, citing the parties' agreement for the engineer to determine the date of substantial completion. The district court also found the date of final completion was January 13, 2004. The parties do not *949 dispute the date of final completion, and Carrothers does not seem to take issue with the district court's assessment of liquidated damages for 1 additional day from substantial completion until final completion of the contract. However, Carrothers contends the district court erred in determining the date of substantial completion was January 12, 2004.
Carrothers argues the date of substantial completion was November 10, 2003. By this date, the City had shut down its old plant and had switched its operations to the new plant. Therefore, Carrothers argues that it met the contract's definition of substantial completion on November 10, 2003, because by that date the work was being utilized for what the parties had intended.
Carrothers' interpretation of the definition of substantial completion ignores the contractual definition of "work." Carrothers also ignores that the contract documents specifically provided for the engineer to determine when the work was sufficiently completed. Under the contract documents, the definition of substantial completion directly incorporated the definition of work. The definition of work specifically included completion of the computerized control system. The computerized control system was not completed by November 10, 2003. Although the City was operating the new plant by that date, the City employees operated the plant manually while waiting for Carrothers to complete the control system. MKEC determined that Carrothers did not substantially complete the control system and other safety features until January 12, 2004.
Thus, under the plain language of the contract and the undisputed facts set forth in the parties' motions for summary judgment, Carrothers did not achieve substantial completion of the contract until January 12, 2004. Accordingly, the district court did not err in determining this was the date of substantial completion. As previously indicated, the parties do not dispute the date of final completion was January 13, 2004. Accordingly, the City is entitled to liquidated damages up to and including these dates provided that the liquidated damages clause in the contract does not constitute a penalty.

Whether the liquidated damages clause constitutes a penalty
Next, Carrothers contends the liquidated damages provision in its contract with the City constituted an unenforceable penalty under Kansas law. The burden of proving that a liquidated damages clause constitutes an unenforceable penalty rests with the party challenging the provision. TMG Life Ins. Co. v. Ashner, 21 Kan.App.2d 234, 250, 898 P.2d 1145 (1995).
Parties to a contract may stipulate to a set amount of damages for breach of the contract as long as the provision constitutes a liquidated damages clause and not a penalty. The distinction between a provision for liquidated damages and one for a penalty is that a penalty is to secure performance, while a liquidated damages provision is for the payment of a sum in lieu of performance. Oriental Gardens, Inc., 32 Kan.App.2d at 561, 86 P.3d 543.
To determine whether a stipulated damages provision constitutes a liquidated damages clause or an unenforceable penalty, Kansas courts employ the following test:
"`"The instrument must be considered as a whole, and the situation of the parties, the nature of the subject matter and the circumstances surrounding its execution taken into account. There are two considerations which are given special weight in support of a holding that a contractual provision is for liquidated damages rather than a penaltythe first is that the amount stipulated is conscionable, that it is reasonable in view of the value of the subject matter of the contract and of the probable or presumptive loss in case of breach; and the second is that the nature of the transaction is such that the amount of actual damages resulting from default would not be easily and readily determinable."' TMG Life Ins. Co. v. Ashner, 21 Kan.App.2d at 250, 898 P.2d 1145 (quoting Beck v. Megli, 153 Kan. 721, 726, 114 P.2d 305 [1941])." 32 Kan.App.2d at 561, 86 P.3d 543.
*950 This court has stated that the "reasonableness of a liquidated damages clause should be determined as of the time the contract was executed, not with the benefit of hindsight." TMG Life Ins. Co., 21 Kan. App.2d 234, Syl. ¶ 19, 898 P.2d 1145. Carrothers disagrees with this assertion and cites Hutton Contracting Co., Inc. v. City of Coffeyville, 487 F.3d 772, 781 (10th Cir.2007), which notes that in some jurisdictions, courts additionally compare the amount that would be awarded under the liquidated damages provision with the actual damages a party suffered; that is, the courts take an additional "retrospective" look at actual damages. See, e.g., Yockey v. Horn, 880 F.2d 945, 953 (7th Cir.1989) (if a party has suffered no damages whatsoever from the breach, the liquidated damages clause will be unenforceable no matter how reasonable the estimate of damages was at the time of the contract); Restatement (Second) of Contracts § 356 (1981) (liquidated damages must be reasonable in light of the anticipated or actual loss caused by the breach). The Hutton court indicated that Kansas courts have not definitively answered the question whether the enforceability of liquidated damages provisions should be determined prospectively only, or whether Kansas courts would also apply a supplemental retrospective analysis. 487 F.3d at 781.
However, this court has also stated that "to recover under a liquidated damages clause, the amount of liquidated damages must bear some reasonable relationship to the actual injury caused by the breach. If such amount bears no such relationship, it is a penalty and void." Oriental Gardens, Inc., 32 Kan.App.2d at 564, 86 P.3d 543. In Oriental Gardens, this court determined that an accelerated rent provision constituted an unenforceable penalty because it applied to all breaches of the contract, however major or minor, and had no reasonable relationship to the actual injury caused by the breaches. 32 Kan.App.2d at 562, 86 P.3d 543. Thus, to the extent this court has acknowledged that liquidated damages must bear some reasonable relationship to the actual injury or damages caused by the breach, this court has recognized that a retrospective analysis of a liquidated damages clause is also appropriate. See Luminous Neon, Inc. v. Parscale, 17 Kan.App.2d 241, 243, 836 P.2d 1201 (1992) (a liquidated damages clause that fixes damages in an amount grossly disproportionate to the harm actually sustained or likely to be sustained is considered a penalty).
Returning to our facts, to determine whether a liquidated damages provision is enforceable, the first inquiry is whether the stipulated amount is conscionable, i.e., that it is reasonable in view of the value of the subject matter of the contract and of the probable or presumptive loss in case of breach. Oriental Gardens, Inc., 32 Kan. App.2d at 561, 86 P.3d 543. Here, the subject matter of the contract was the construction of a new public wastewater treatment facility for over $5,600,000. As the City points out, the total liquidated damages of $145,350 for a nearly 6-month delay is less than 3% of the total contract amount. The probable or presumptive loss in case of delay included the City's cost to monitor the project, additional labor costs, additional use of utilities, the cost of engaging another consultant, legal expenses, equipment rental to address flow situations, possible action by the KDHE, and other unknowns in the event the project was not completed on time. MKEC anticipated having an engineer's representative on site daily if the facility was not completed on time, as well as additional environmental department staff, structural and electrical staff, and controls department staff. In light of these potential actual expenses, the amount set forth in the contract of $850 per day is reasonable when viewed prospectively.
Nevertheless, Carrothers argues the amount of liquidated damages was unreasonable when viewed retrospectively because the City did not incur any actual damages caused by Carrothers' delay in completing the wastewater treatment facility. Carrothers' claim is not supported by the record. The record reflects that, at a minimum, the City incurred actual damages by having an engineer on site daily until the project was completed. The delay in completion of the facility also required additional City staff involvement. Thus, the amount of liquidated damages set forth in the contract of $850 per *951 day was reasonable when viewed retrospectively in relation to the actual damages sustained by the City caused by Carrothers' delay.
The second inquiry in determining whether to enforce a liquidated damages provision is whether the nature of the transaction is such that the amount of actual damages resulting from default would not be easily and readily determinable. Oriental Gardens, Inc., 32 Kan.App.2d at 561, 86 P.3d 543. Here, Moore stated in his deposition that MKEC always includes a liquidated damages clause in its public works contracts because it is difficult to determine what damages could be incurred and it could be costly to prove those damages in court. The district court noted the complexity of the project and its attendant risks of harm and damages. As demonstrated by the many factors MKEC considered in determining the appropriate amount of liquidated damages, the actual damages would have been difficult to calculate at the time the parties entered into the contract. Therefore, this second factor also favors enforceability of the liquidated damages provision.
In summary, the uncontroverted evidence established that Carrothers did not achieve substantial completion of the contract until January 12, 2004, and the contract was not finally completed until January 13, 2004. The amount of the liquidated damages under the contract was reasonable when viewed prospectively and also when viewed in relation to the actual damages caused by the breach. Finally, the nature of the transaction was such that the amount of actual damages resulting from default was not easily and readily determinable. Under these circumstances, we conclude the district court did not err in awarding liquidated damages and in granting summary judgment in favor of the City.
Affirmed.
