This is a suit on a promissory note executed in partial payment for the purchase of residential real estate. Defendants in the suit were Jester, the maker of the note, and Gibson and Kidwell, partners in Points Plus, who purchased the property encumbered by the debt. Jester and Points Plus raised the defense of usury and Jester counterclaimed for damages and attorney fees. The trial court gave judgment to the plaintiff in the amount of past due installment payments on the note and awarded Jester damages and attorney fees. All the defendants appealed.
*456The facts relevant to the appeal are undisputed. On June 1,1982, respondent sold the property in question to Jester for $70,-000.00. The sum of $7,000.00 was paid in cash and the balance was evidenced by a note for $63,000.001 bearing interest at 17% per year with interest and principal repayable in monthly installments of $905.94. Jester made these monthly payments until November, 1985 when she sold the property to Gibson and Kidwell.
As of June, 1982, the legal rate of interest, § 408.020, RSMo 1986,2 was nine percent per annum and the contract rate of interest was not to exceed 16.6%, See § 408.030. Prior to November, 1985, no complaint had been made to respondent that the rate of interest on the note exceeded the allowable statutory maximum.
Points Plus remitted the November, 1985 installment payment and a 10% penalty charge to respondent and also proposed that respondent supply a payoff figure for the purpose of liquidating the debt obligation. Respondent indicated that she was unwilling to accept prepayment and insisted that the schedule of monthly payments for the full term of the note be observed. The record is not clear as to whether respondent was willing to accept prepayment if the sum included the penalty stated in the note.3 Efforts to resolve the dispute failed and Points Plus made no further payments. This suit followed.
Respondent described her cause of action as one for specific performance under which, presumably, she would secure a judgment directing the defendants to pay the note installments as they became due. The trial court denied this relief and instead entered judgment in respondent’s favor for $20,836.62, calculated as twenty-three monthly payments of $905.94 each, covering the period from December 1, 1985 to the date of judgment. Respondent has filed no cross-appeal and appellants have asserted no defense on the ground that specific performance is not an available remedy in a suit on a promissory note. We therefore do not consider whether respondent’s petition stated a cause of action or whether the judgment rendered was responsive to the petition.
The trial court also entered judgment for Jester and against respondent on Jester’s counterclaim allowing double the amount of usurious interest paid by Jester during the period before the property was sold to Points Plus. These damages and attorney fees amounted to $3672.26 for which judgment was entered against respondent. Again, respondent has filed no cross-appeal and therefore the issue of liability on the counterclaim is not in question. Jester’s appeal, however, contends the interest was incorrectly calculated and the amount of damages should have been greater.
The pivotal issues in the case, affecting the appeals of Jester and Points Plus, are what rate of interest should be applied to compute Jester’s damages allowable under § 408.030 and what is the legal rate of interest respondent may collect on the balance of unpaid note installments. Both questions are posed in the factual setting earlier described, that is, agreement that the interest rate specified in the note was in excess of that permitted by law to be charged.
The trial court ruled by a preliminary order entered in the case that the applicable interest rate in both instances is 16.6% determined to be the “market rate” of interest set by the director of the state division of finance as of July 1, 1982 in accordance with § 408.030.3. The damages awarded Jester were based on the difference between interest she paid and the interest otherwise payable under the market rate. It is to be assumed, although the judgment does not expressly so state, that the court intended for the market rate to *457be applied to the remaining installment payments due on the note.
Appellants collectively complain that the court erred when it settled on 16.6% as the interest rate on the note, both for purposes of Jester’s counterclaim and for allowance of judgment to respondent on the original claim. They argue that the rate for all purposes should have been 9% as provided in § 408.020.
The dispute is attributable to the fact that Missouri statutes set two maximum rates of interest in transactions of this type, one applicable in cases where the parties have not agreed on the rate and the other a maximum rate which may be set by express contract. The former, a 9% rate, is specified in § 408.020 and the latter is either 10% or a rate not to exceed the market rate as provided in § 408.030.
As the following discussion will undertake to demonstrate, Jester’s counterclaim and respondent’s claim are distinguishable in theory and are not related to the same statutory provisions. It does not necessarily follow, as the trial court concluded, that the same rate of interest must prevail in both aspects of the case. On this account, we will first consider Jester’s counterclaim.
I.
In her counterclaim, Jester sought damages and attorney fees and relies on § 408.030.2. That subsection reads as follows:
If a rate of interest greater than permitted by law is paid, the person paying the same or his legal representative may recover twice the amount of the interest thus paid, provided that the action is brought within five years from the time when said interest should have been paid. The person so adjudged to have received a greater rate of interest shall also be liable for the costs of the suit, including a reasonable attorney’s fee to be determined by the court.
The above quoted statute is remedial because it imposes a penalty which accrues to the party aggrieved, to be recovered by private action. Tabor v. Ford, 241 Mo. App. 254, 258, 240 S.W.2d 737, 740 (1951).
A remedial statute is to be liberally construed so as to meet the cases which are clearly within the spirit or reason of the law. State ex rel. LeFevre v. Stubbs, 642 S.W.2d 103, 106 (Mo.banc 1982).
The purpose of § 408.030 is first to establish a flexible basis for determination of permissible interest rates to which parties may contract conformable to market conditions. The second purpose is to restrain those otherwise disposed to do so from exacting higher rates by imposing a penalty. The punitive aspect, however, is referable only to interest actually paid. No penalty is recoverable merely because a contract obligates the borrower to pay interest in excess of the market rate.
Jester’s position as counterclaimant is distinguishable from her defense to the principal suit primarily because § 408.030.2 is available only as an offensive tool and then, only if some payments of usurious interest have been made. No dainages are recoverable under this section for excessive interest charged but not paid. The fact that the present case originated in a suit by the holder of the note for unpaid installments is an irrelevant circumstance which does not affect the substance and merits of Jester’s affirmative claim to the penalty.
Considered on its separate facts, the counterclaim simply alleges a cause of action under § 408.030. That statute, as noted earlier, provides both a limit on the permissible rate of interest, together with a means of determining the rate, and an enforcement mechanism. The reason for the second subsection allowing recovery of a penalty is to assure compliance with the first subsection. The two subsections are interrelated components of a single scheme to regulate the charging of contract interest. The phrase, “rate of interest greater than permitted by law,” under the circumstances of this case, necessarily must refer to the “market rate” as set out in the previous subsection if the remedial provision is to have the effect which the spirit and reason of the law indicate.
A cause of action asserted under § 408.030 against a lender who has con*458tracted for payment of usurious interest presents no occasion for any reference to other sections of Chapter 408 because § 408.030 provides both the limits by which the contract interest rate may be measured and the penalty for the violation. The claimant is entitled to recover an amount equal to twice the difference between the permissible market rate of interest as determined by the director of the division of finance on the date of the contract and the interest actually paid and costs of suit. The trial court correctly calculated Jester’s damages, there is no issue raised as to the award of attorney fees and, therefore, the judgment on Jester’s counterclaim should be affirmed.
II.
Appellants’ next claim of error is that the trial court incorrectly held the interest rate of 16.6% to be applicable for computing the balance due on the subject note. To reach this conclusion as to what was decided, it is necessary to combine the court’s order of June 17, 1987 with the judgment recorded October 13, 1987. In the former, the court sustained respondent’s motion for partial summary judgment and ruled, in part:
The interest rate of 17 percent per annum provided for by the note in question is usurious. The legal rate of interest on said note is 16.6 percent per an-num, that permitted by law.
The October 13, 1987 judgment awarded respondent the sum of $20,836.62 computed as twenty-three installment payments for an equivalent number of months. The judgment did not specify how the amount so adjudged was to be credited as between interest and principal on the note nor did the judgment recite what principal balance was owed as of the date of the last prior monthly installment paid. Those questions will be addressed later in this opinion. We first take up the issue of what interest rate is applicable to the unpaid note debt, the market rate of 16.6% or the legal rate of 9%. Appellants contend the rate is 9% because the agreement to pay usurious interest was void leaving the parties with no contract for payment of a set interest rate.
What shall constitute usury is a matter of statute law, as are the penalties for charging excessive interest. In Missouri, §§ 408.050 and 408.060 contain the prohibition against usurious interest and, apart from § 408.030 discussed earlier, provide for penalties. Under § 408.050, a borrower who has been charged usurious interest is authorized to recover the excess interest charges and costs.4 Section 408.060 is available to assist the borrower who is sued for payment of usurious interest and authorizes the defense of usury to be interposed in a civil cause.
As noted earlier in this opinion, Missouri statutes make provision for two possible interest rate charges, a fixed rate of 9%, “when no other rate is agreed upon,” and a flexible market rate to which the “parties may agree, in writing.” Thus, entitlement to collect a higher rate of interest than 9% from the borrower depends on proof that the borrower has contracted in writing to pay the higher rate.
Appellants’ defense against respondent’s petition claim, as contrasted with the affirmative contention by Jester in her counterclaim, is based on § 408.060. In relevant part, the statute provides that in a civil action, usury may be pleaded as a defense and the party exacting usurious interest shall recover judgment for no more than the principal debt, “with legal interest.” The question is, what constitutes legal interest where the contracted rate is usurious. We conclude that the terms “legal rate of interest” and “legal interest” as used in §§ 408.050 and 408.060 refer to the rate of 9% established under § 408.020.
In this case, appellants contend that the only contract upon which respondent may rely to collect a rate of interest in excess of *4599% is unenforceable because the rate of 17% was usurious and prohibited under § 408.050. They say, therefore, that without a contract rate, respondent is limited to the legal rate of 9% set by § 408.020 in cases where no other rate has been agreed upon.
Where the defense of usury is presented, as authorized by § 408.060, it is first necessary to determine if the rate permissible in the circumstances is 9% because there was no written agreement or is the market rate under the parties’ written contract. Once it be determined, as here, that the rate charged was in excess of the maximum market rate, then § 408.030 is no longer relevant because an agreement to pay interest in excess of the lawful rate is invalid, unenforceable and void. Anderson v. Curls, 809 S.W.2d 692, 696 (Mo.App.1958). By direction of the statutes, a lender is authorized to collect interest of more than 9% only if there is an agreement in writing to that effect. A lender, such as respondent, who has extracted an agreement from the borrower to pay interest in excess of the market rate loses the benefit of the written agreement setting the interest rate once the defense of usury is established. Without a written agreement, the lender has no recourse to § 408.030 as a basis to charge more than 9% interest.
In this case, the trial court effectively rewrote the mortgage note to substitute for the invalid contract setting a rate of 17%, a new agreement imposing on the borrower a rate of 16.6%, the maximum market rate. There is no statutory authority to involuntarily impose such an obligation in a case where usury has been proved. The invalidation of the usurious contract leaves the parties with no agreement on the subject and limits the lender to a recovery of no more than 9% as § 408.020 specifies. The trial court erred in its order for partial summary judgment and should have held that the legal rate of interest recoverable by respondent on the unpaid balance of the note is 9% per year.
III.
Appellant Points Plus raises the further question of a failure by the trial court to give credit for its tender into court on December 29, 1986 of the sum of $44,-310.88 for which it proposed that judgment be entered in favor of respondent. It argues that because respondent recovered a judgment for less than this amount, under § 514.250, respondent should be obligated to pay the costs accrued in the case and should be entitled to recover no interest accumulating after that date. The judgment gave no recognition to the tender and did not specify how the costs were to be taxed.
The basis for computing the amount Points Plus deposited in the registry of the court assumed the interest rate to be charged on the note was 9% from June 1, 1982. That entailed a recalculation of credits to principal for payments made by Jester and a corresponding reduction in the balance owed on the note as of December 1, 1985. In view of our conclusion that the 9% rate was not applicable for the purpose of Jester’s counterclaim, it follows that the note balance is not correctly computed under the assumptions forming the basis for the tender.
It is correct, as appellants argue, that the actual dollar amount of the judgment recovered by respondent was less than the amount of the tender. The judgment for respondent, however, was not on the same terms as the tender which conditioned acceptance on satisfaction of the full note balance. In this respect, coupled with the interest rate differential, the tender was insufficient to invoke application of § 514.250.
IV.
Appellant Jester next contends the court erred when it denied leave to amend the crossclaim to include a demand for prejudgment interest or, alternatively, that the court erred in failing to include prejudgment interest in the damages awarded Jester.
It is not clear from this record whether the trial court based its refusal to allow prejudgment interest on the content of the pleading, but the court did indicate the *460motion to amend for the purpose of adding the claim came too late. That ruling certainly lies within the discretion of the trial court and may not be disturbed.
The allowance of prejudgment interest is not, however, dependent on an express petition allegation seeking that relief. In Haynes v. Allen, 482 S.W.2d 85, 89 (Mo.App.1972), and General Aggregate Corp. v. LaBrayere, 666 S.W.2d 901, 910 (Mo.App.1984), the court held a petition which prayed the court “to grant such other and further relief as the court may deem meet and proper in the premises,” and “such other relief as may be proper under the premises” to be sufficient to authorize the award of prejudgment interest on a debt. It is not necessary for evidence to be presented or for a jury to be instructed on the subject where prejudgment interest is only a matter of mathematical computation. General Aggregate Corp. v. LaBray-ere, 666 S.W.2d at 910.
Appellant Jester’s claim to prejudgment interest on the award to her of excess interest paid and the penalty should have been allowed at the statutory rate of 9%, Cotton v. 71 Highway Mini-Warehouse, 614 S.W.2d 304, 308 (Mo.App.1981), from the date of demand. There being no indication otherwise, the date of demand is taken to be the date on which the counterclaim was filed, December 19, 1986. Lester v. Davidow’s Decor, Inc., 522 S.W.2d 148,152 (Mo.App.1975).
V.
In the final point to be discussed, appellant Points Plus contends the trial court erred when it ordered payment of the 23 delinquent installments of $905.94 each without determining what principal balance remained due on the note and without specifying how the payments were to be applied. It argues that a judgment based on the payment schedule set out in the note effectively ratifies the usurious 17% interest rate.
It is apparent that the judgment did not settle the controversy between the parties and that even were the judgment to have been affirmed, disagreement would still remain in several areas. The record on appeal, however, contains sufficient facts from which an appropriate judgment may be crafted, consistent with the findings already made. Under Rule 84.14, this court is empowered to give such judgment as the court ought to give and to finally dispose of the case. Pannell v. Missouri Insurance Guaranty Association, 595 S.W.2d 339, 356 (Mo.App.1980). We undertake to do so.
With regard to the principal balance due on the note, the trial record and exhibits indicate that the court computed the credits due on the note for payments made through November 1, 1985. Using the interest rate of 16.6%, as we have concluded was correct for that period, the principal note balance on that date was $59,525.56. Respondent is due that sum with interest computed from November 1, 1985 at the rate of 9% per year until the full note balance is paid.
We further find that the defense of usury is sufficient to avoid imposition of the 10% late payment penalty imposed by the terms of the note, except as to any subsequent default in the payment of note installments falling due after the date of judgment.
The judgment must also take account of the fact that the debt owed respondent is repayable in monthly installments, all of which have not yet matured. Thus, the judgment must record respondent’s entitlement to current payment only of matured installments, subject to appellants’ privilege to repay the full amount of the note at any time.5
This cause is, therefore, remanded to the trial court with directions to enter the following judgment:
(1) That plaintiff, Dorothy L. Addison, have and recover of and from defendants *461Ida Ruth Jester, John M. Gibson and William R. Kidwell, Jr. the sum of $29,896.02, and the additional sum of $905.94 for each month after August, 1988, if any, which shall intervene before judgment is entered, the amount so adjudged to be applied first to interest at 9% per year on the principal balance of the note dated June 1, 1982, the latter sum being determined to be $59,-525.56, with interest from November 1, 1985, and the balance applied to principal, and interest to accrue thereafter at 9% per year, with the remaining balance of principal and interest payable in monthly installments of $905.94 on the first day of each month, and
(2) That counterclaiming plaintiff, Ida Ruth Jester, have and recover of and from the plaintiff, Dorothy L. Addison, the sum of $2,172.26 together with interest on said amount from December 19,1986 at the rate of 9% per year, and an attorney fee of $1,500.00, and
(3) That the costs of suit be assessed against plaintiff, Dorothy L. Addison.
The costs of appeal are ordered to be divided between the parties, one-half thereof charged to appellants and one-half thereof charged to respondent.
All concur.