This case involves a controversy concerning a contract for the sale of an insurance business. On or about January 25, 1980, Plaintiff James W. Bowen (Bowen) entered into a stock purchase agreement with Defendant Carlsbad Insurance and Real Estate (Carlsbad), whereby Carlsbad was to redeem all of Bowen’s stock for a total purchase price of $796,751. Bowen was the president and majority shareholder of Carlsbad, a New Mexico corporation, having its principal place of business in Carlsbad, New Mexico. Bowen owned ninety percent of the outstanding stock. The total consideration payable to Bowen over a fifteen-year period would be $1,275,219.97, including interest. The agreement provided that payments would be made monthly, annually, and in lump sums. The monthly obligations were divided into four notes. Subparagraph (a) provided a note for $320,-000 payable in monthly installments of $3245 principal and interest. Subparagraphs (b), (c), and (d) provided for notes totaling $267,000. These latter notes represented obligations which third parties owed to Carlsbad. The purchase agreement contained the following covenant not to compete:
The Seller agrees not to compete, directly or indirectly, with the Buyer in the insurance and real estate business within a radius of 15 miles from Carlsbad, New Mexico, for a period of 15 years. In the event the Seller reaquires [sic] ownership of the Buyer by exercising his option as above provided, then, and in that event, Oran Means covenants and agrees not to compete with the Seller in the insurance and real estate business within a radius of 15 miles of Carlsbad, New Mexico, for a period of 15 years. In the event of the breach of this covenant, the breaching party agrees to pay the sum of $100,-000.00 as liquidated damages.
This action was commenced when Bowen brought a petition for declaratory judgment against Carlsbad. Bowen alleged that the covenant not to compete was unreasonable regarding the time limitation and also that the liquidated damage clause was void because it constituted a penalty. The reasonableness of the territorial limitation was unchallenged. Carlsbad counterclaimed and alleged that Bowen breached the contract by soliciting insurance business and setting up an insurance office in Carlsbad, New Mexico. Carlsbad prayed for an injunction, enjoining Bowen from violating the agreement not to compete, and in addition for $100,000 in liquidated damages, and $100,000 punitive damages for Bowen’s alleged willful and malicious interference with Carlsbad’s business.
The trial court found the fifteen-year restrictive covenant reasonable and enforceable. The court considered the fifteen-year amortized payout of the purchase price, the total consideration paid for the insurance business, and that the restriction would not curtail Bowen’s efforts to earn a livelihood because he would be receiving payments in *516excess of $65,000 per year. The court granted Carlsbad an injunction against Bowen, prohibiting him from engaging in the insurance business within fifteen miles from Carlsbad, New Mexico, for the remaining period of the fifteen-year covenant not to compete. Bowen appeals and Carlsbad cross-appeals from the trial court’s decision denying it liquidated damages. We affirm.
Bowen raises the following issues on appeal: (1) whether the fifteen-year covenant is reasonable and enforceable; (2) whether there is substantial evidence to support the court’s finding that the fifteen-year covenant was based upon the fifteen year amortized payout of the purchase price; and (3) whether the district court erred in failing to conclude that Bowen had an option to pay the liquidated damages and resume the insurance business.
It is well-settled that a restrictive covenant is valid if it is within reasonable limits of time and space and ancillary to a sale of a business. Thomas v. Gavin, 15 N.M. 660, 110 P. 841 (1910). Courts are more reluctant to disturb restrictive covenants in buy-sell agreements than those in employment contracts. Insurance Center, Inc. v. Hamilton, 218 Ga. 597, 601, 129 S.E.2d 801, 804 (1963); Alabama Binder & Chemical Corp. v. Pennsylvania Industrial Chemical Corp., 410 Pa. 214, 218, 189 A.2d 180, 184 (1963); Gann v. Morris, 122 Ariz. 517, 518, 596 P.2d 43, 44 (App.1979). Whether there is a reasonable restraint depends on the facts of a particular case, D. W. Trowbridge Ford, Inc. v. Galyen, 200 Neb. 103, 106, 262 N.W.2d 442, 445 (1978), and is a matter of law for the courts to decide. E.g., Gann, 122 Ariz. at 518, 596 P.2d at 44; Greer v. Lifsey, 128 Ga.App. 785, 197 S.E.2d 846 (1973). In determining reasonableness, courts consider such factors as the nature of the business, its location, the parties involved, the purchase price, and the main object of the restriction. Gann v. Morris.
Agreements in partial restraint of trade ancillary to the sale of a business appear to be sanctioned because of the value of the goodwill purchased. Palumbo v. Piccioni, 89 N.J.Eq. 40, 103 A. 815 (1918). Bowen contends that this covenant not to compete is unreasonable because it is broader than necessary to protect Carlsbad’s legitimate interests and to secure the goodwill of the business. Bowen argues that the court incorrectly applied the criteria for determining reasonableness by finding that $796,751 was the total purchase price for the insurance business. Bowen claims that the assigned value of the insurance business was listed under subparagraph (a) as $320,000, and that the notes in subparagraphs (b), (c), and (d) should not have been considered as part of the total consideration because they are “pass throughs” (i.e., obligations owed to Carlsbad which would directly be paid to Bowen). We disagree. Even if the remaining notes were “pass throughs,” it is indisputable that Carlsbad is still liable for the notes. Carlsbad has been and will continue to remit payments to Bowen, totaling $1,275,219.97, including interest, which could otherwise be retained as an asset for Carlsbad.
Here Carlsbad paid a total purchase price of $796,751 for the insurance business. “The size of the purchase price * * * is [an] indication of both the necessity for, and the intention that there should be, a substantial period of freedom from competition * * * during which the purchase price could be amortized.” Bonneau v. Meaney, 343 Mass. 368, 371, 178 N.E.2d 577, 579 (1961). A large part of the value of the business, and the principal inducement to pay such a high price, consisted in the protection which the covenant afforded against competition. See Gonzales v. Reynolds, 34 N.M. 35, 37, 275 P. 922, 923 (1929). It was proper for the trial court to consider the purchase price and the fifteen-year amortized period necessary to protect the goodwill of the business.
Moreover, Carlsbad bought an insurance business from Bowen who previously owned ninety percent of the stock, was the president of the company, and had “inside” knowledge about customers and policy renewals. “An insurance agency is by na*517ture dependent upon personal contracts.” Insurance Center, Inc., 218 Ga. at 602, 129 S.E.2d at 805. Sales result primarily because of the goodwill built by the agent. In the instant case, Bowen was an established and successful insurance agent in the small community of Carlsbad, New Mexico. If he were allowed to solicit insurance policies, Carlsbad’s goodwill would be destroyed. See id.
Bowen’s argument that the purpose of the agreement was to restrict competition and therefore is void as against public policy is unpersuasive. The main object of this agreement was not to “stifle competition.” Gross, Kelly & Co. v. Bibo, 19 N.M. 495, 520, 145 P. 480, 489 (1914). The object of the restrictive covenant in this case was to protect Carlsbad against the competition of Bowen in the insurance business in Carlsbad, New Mexico for a fifteen-year period. There is no doubt that to some extent such an agreement will restrict competition, but it is valid because it is incidental to some legitimate business transaction.
Therefore, in our opinion, the restrictive covenant is not void as a restraint of trade. It is limited as to time and space and is subsidiary to the main purpose of disposing of an established business. Furthermore, there was no bad faith in negotiating the contract between the parties as evidenced by the reciprocal provision contained in the covenant. The covenant should be enforced as written; it being entered into voluntarily and for consideration. “ ‘It is as much a matter of public concern to see that valid engagements are observed as it is to frustrate oppressive ones.’ ” Meissel v. Finley, 198 Va. 577, 584, 95 S.E.2d 186, 191 (1956) (quoting Sonotone Corp. v. Baldwin, 227 N.C. 387, 42 S.E.2d 352 (1947)). See also Lovelace Clinic v. Murphy, 76 N.M. 645, 650, 417 P.2d 450, 453 (1966) (public interest in enforcing contractual rights and obligations).
Bowen next maintains that there was no substantial evidence to support the trial court’s finding that the fifteen-year covenant was based upon the fifteen-year amortized payout of the purchase price. There is substantial evidence to support the trial court’s finding. In determining the reasonableness of the restrictive covenant, the court, as stated above, could properly consider: the purchase price of the insurance business; the fifteen-year amortized payout period, which incidentally parallels the fifteen-year covenant; the size of the community; the nature of the business; and Bowen’s prominence in the business. It was not erroneous for the court to reasonably infer that the parties considered some, if not all, of these factors in determining the length of the restrictive covenant. Substantial evidence reasonably supports the factual determinations of the trial court. See Martinez v. Martinez, 101 N.M. 88, 91, 678 P.2d 1163, 1166 (1984); Britton v. Britton, 100 N.M. 424, 430, 671 P.2d 1135, 1141 (1983).
Bowen also contends that the court erred in failing to conclude that he had the option to pay the liquidated damages and then engage in the insurance business. An agreement, of course, can be written to allow the parties to have the option to perform the contract or pay the damages. Bauer v. Sawyer, 8 Ill.2d 351, 134 N.E.2d 329 (1956). In this case, however, the parties did not intend the liquidated damages clause to constitute a payable privilege to engage in conduct which was forbidden by the contract. See U-Haul Company of North Carolina, Inc. v. Jones, 269 N.C. 284, 287, 152 S.E.2d 65, 67 (1967). The agreement indicates, and the record testimony shows, that the parties’ intentions were to include a liquidated damage provision to insure the faithful performance of this restrictive covenant.
The remaining issue concerns the trial court’s denial of liquidated damages. On cross-appeal Carlsbad argues that the liquidated damages clause was enforceable and that, in addition to injunctive relief, the court should have awarded it $100,000 damages. The court found that Bowen, anticipating a favorable decision, began setting up an insurance business, but ceased immediately when the court found that the fifteen-year covenant was enforceable. Thus, *518the court found that Bowen did not act in bad faith and that Carlsbad had not suffered substantial damages. We agree. Carlsbad failed to submit evidence supporting any actual damages suffered. Carlsbad contends, however,, that because the contract stipulated a sum in the event of a breach that its recovery cannot be diminished by showing that its actual loss was less.
Carlsbad’s contention that it should be entitled to both injunctive relief and liquidated damages is untenable. A party can elect liquidated damages or injunctive relief, but cannot have both. Thomas, 15 N.M. at 665, 110 P. at 843; Wirth & Hamid Fair Booking, Inc. v. Wirth, 265 N.Y. 214, 217, 192 N.E. 297, 300 (1934), reh’g denied, 265 N.Y. 510, 193 N.E. 295 (1934).
Based on the foregoing, the judgment of the trial court is affirmed.
IT IS SO ORDERED.
RIORDAN, C.J., and FEDERICI, J„ concur.