
568 So.2d 784 (1990)
MILTON CONSTRUCTION COMPANY, INC.
v.
STATE of Alabama HIGHWAY DEPARTMENT, et al.
89-514.
Supreme Court of Alabama.
September 14, 1990.
*785 Rodney A. Max and Denise J. Lord of Najjar, Denaburg, Meyerson, Zarzaur, Max, Wright & Schwartz, Birmingham, for appellant.
Jack F. Norton, Jerry L. Weidler and Janie Baker Clarke, Montgomery, for appellees.
Truman M. Hobbs, Jr. of Copeland, Franco, Screws & Gill, Montgomery, for amicus curiae Hardaway Co.
HOUSTON, Justice.
This is an appeal from a summary judgment in favor of the defendants, the State of Alabama, State of Alabama Highway Department, and Royce King, as director of the State of Alabama Highway Department (hereinafter collectively referred to as "Highway Department"). The plaintiff, Milton Construction Company ("Milton"), had sought a judgment declaring that the disincentive clause of an incentive/disincentive payments provision in each of two highway construction contracts that it had entered into with the Highway Department was void and unenforceable as a penalty and requested that the trial court order the Highway Department to pay Milton the amounts of disincentive payments that it withheld.
The issues before us are whether a clause of a construction contract that authorizes the withholding of disincentive payments is void and unenforceable as a penalty; whether Milton is estopped from asserting a claim that the disincentive clause is void where it has previously received incentive compensation pursuant to the incentive clause of the incentive/disincentive payments provision in a prior contract; and whether the trial court erred in failing to strike an affidavit allegedly based on hearsay.
Summary judgment is proper where there is no genuine issue of material fact and the moving party is entitled to a judgment as a matter of law. Rule 56, A.R. Civ.P. All inferences must be viewed in the light most favorable to the nonmoving party, and all reasonable doubts concerning the existence of a genuine issue of material fact must be resolved against the moving party. See Wilson v. Brown, 496 So.2d 756 (Ala.1986); see, also, McMillian v. Wallis, 567 So.2d 1199 (Ala.1990). This case was filed after June 11, 1987; therefore, the applicable standard of review is the "substantial evidence" rule. Ala.Code 1975, § 12-21-12; see, also, Watters v. Lawrence County, 551 So.2d 1011 (Ala. 1989); see, also, Koch v. State Farm Fire & Casualty Co., 565 So.2d 226 (Ala.1990).
The facts of this case are substantially undisputed. The Highway Department and Milton entered into contracts for widening and repairing a portion of Interstate Highway 65 (hereinafter referred to as the "I-65 *786 Project")[1] in Jefferson County and for concrete pavement rehabilitation of, and the addition of median lanes to, a portion of Interstate Highway 59 (hereinafter referred to as the "I-59 Project")[2] in Jefferson County.
The total cost of the I-65 Project was $7,745,320.29, and the total cost of the I-59 Project was $4,399,883.25. Subsequent to the filing of this lawsuit, the parties stipulated to all amounts due and payable to Milton (which have now been paid) except for the disputed amounts of $300,000 and $240,000 that the Highway Department deducted from Milton's contract price for the I-65 and I-59 Projects, respectively, pursuant to an incentive/disincentive payments provision. (The incentive clause of the incentive/disincentive payments provision is not at issue.)
The incentive/disincentive payments provision[3] of each contract reads, in pertinent part, as follows:
"The Contractor's attention is directed to the fact that it is in the public's interest to complete this project at the earliest possible date taking into account the traffic control plan and sequence of construction specified in the plans. The completion of the entire project and final acceptance by the Department must be accomplished within 330 Calendar Days [in the I-65 Project; 210 Calendar Days in the I-59 Project].
". . . .
"1. If and when the Engineer determines that the Contractor will exceed the contract time allowed, as previously specified, the Engineer will suspend further payments otherwise due the Contractor until the amount of the suspended payments equal[s] the maximum decrease described below:

"For each day of overrun, up to 60 Calendar days, total payment due to the Contractor will be decreased by $5,000.00 [in the I-65 Project, and $4,000.00 in the I-59 Project] per calendar day. This disincentive payment will be in addition to the liquidated damages specified in Article 108.11.

". . . .
"3. There will be no further incentive or disincentive adjustment for underruns or overruns exceeding 60 days. The maximum amount to apply to incentive or disincentive will be $300,000.00 [in the I-65 Project and $240,000.00 in the I-59 Project]. Liquidated damages as specified in Article 108.11 will apply until completion and acceptance of the entire project."

(Emphasis added.)
In addition, each contract contained a provision for recovery of actual damages, found in Article 108.12 ("Default of Contract"). It provides, in pertinent part, as follows:
"If the Contractor:
". . . .
"9. For any other cause whatsoever, fails to carry on the work in an acceptable manner, the Engineer will give notice in writing to the Contractor and his surety of such delay, neglect and default.
". . . .
"... The Department may appropriate or use any or all materials and equipment on the ground as may be suitable and acceptable and may enter into an agreement for the completion of said contract according to the terms and provisions thereof, or use such other methods as in the opinion of the Engineer will be required for the completion of said contract in an acceptable manner.

"All costs and charges incurred by the Department together with the cost of completing the work under contract, *787 will be deducted from any monies due or which may become due said Contractor. If such expense exceeds the sum which would have been payable under the contract, then the Contractor and the Surety shall be liable and shall pay to the Department the amount of such excess."

(Emphasis added.)
Furthermore, each contract contained a clause for liquidated damages.[4] Article 108.11 ("Failure to Complete Work Within Contract Time") reads, in pertinent part, as follows:

"Should the Contractor, or in case of default, the surety, fail to complete the work within the time stipulated in the contract or the adjusted time as granted under the provisions of Article 108.09, a deduction for each calendar day or work day that any work shall remain uncompleted, [in] an amount indicated by the Liquidated Damages Schedule shown in Article 108.11 or provided in the contract document shall be deducted from any monies due the Contractor on monthly estimates. ...
"Liquidated damages assessed as provided in these Specifications is not a penalty, but is intended to compensate the State for increased time in administering the contract, supervision, inspection and engineering, particularly the engineering and inspection which requires maintaining normal field project engineering forces for a longer time on any construction operation or phase [than] originally contemplated when the contract period was agreed upon in the contract."
(Emphasis added.)
According to Milton, each contract also contained provisions by which the Highway Department could control its performance and the rate of its performancethe Highway Department could allegedly disqualify Milton from further State work if Milton failed to maintain a satisfactory rate of progress (Article 108.04"Prosecution of Work") and could suspend the work if Milton failed to carry out orders or perform provisions of the contract (Article 108.07 "Temporary Suspension of Work").
Milton exceeded the time stipulated in the contract for completion of the I-65 Project by 156 days, and the Highway Department assessed Milton liquidated damages in the amount of $93,600 ($600 per calendar day for 156 days) and imposed the maximum disincentive of $300,000. Milton exceeded the time stipulated in the contract for completion of the I-59 Project by 72 days, and the Highway Department assessed Milton liquidated damages in the amount of $32,400 ($450 per calendar day for 72 days) and imposed the maximum disincentive of $240,000. Milton does not dispute the enforceability of the liquidated damages provisions. Milton does, however, dispute the enforceability of the disincentive clause of each contract, contending that the clause is void as a penalty, and therefore is unenforceable, and requests that the trial court order the Highway Department to pay Milton the amounts of disincentive payments that it withheld.
Is the disincentive clause of the incentive/disincentive provision of the contracts a penalty?
"The question whether a sum is ... a penalty ... is basically not a question of the law of damages. It is a question of the legal validity of a stipulation in a contract. If the contract which the parties have made is enforceable according to its terms, no troublesome problem of damages is presented; the real problem is whether the bargain of the parties is enforceable."
5 Williston on Contracts § 778 at 686 (3d ed. 1961).
We note that the Alabama Constitution of 1901 has a strong preference for the protection of contractual obligations. The Constitution prohibits the impairment of contractual obligations by the legislative and judicial branches of state government. *788 See Article I, § 22 ("[no] law, impairing the obligations of contracts, ... shall be passed by the legislature") and Article IV, § 95 ("[t]here can be no law of this state impairing the obligation of contracts by destroying or impairing the remedy for their enforcement").
We recognize the right of freedom of contract, which is well expressed in 17 Am. Jur.2d Contracts, § 178 (1964):

"The courts are averse to holding contracts unenforceable on the ground of public policy unless their illegality is clear and certain. Since the right of private contract is no small part of the liberty of the citizen, the usual and most important function of courts of justice is to maintain and enforce contracts rather than to enable parties thereto to escape from their obligations on the pretext of public policy, unless it clearly appears that they contravene public right or the public welfare. Rules which say that a given agreement is void as being against public policy are not to be extended arbitrarily, because `if there is one thing which more than another public policy requires it is that men of full age and competent understanding shall have the utmost liberty of contracting, and that their contracts, when entered into freely and voluntarily, shall be enforced by courts of justice.'
"Many courts have cautioned against recklessness in condemning agreements as being in violation of public policy. Public policy, some courts have said, is a term of vague and uncertain meaning which it is the duty of the law-making power to define, and courts are apt to encroach upon the domain of that branch of the government if they characterize a transaction as invalid because it is contrary to public policy, unless the transaction contravenes some positive statute or some well-established rule of law. Other courts have approved the statement of an English judge that public policy is an unruly horse astride of which one may be carried into unknown paths. Considerations such as these have led to the statement that the power of the courts to declare an agreement void for being in contravention of sound public policy is a very delicate and undefined power and, like the power to declare a statute unconstitutional, should be exercised only in cases free from doubt. The cautionary remarks may be interpreted to mean that in the determination of whether an agreement is against public policy there must be kept in view the rule that where there is no statutory prohibition, the courts do not readily pronounce an agreement invalid on the ground of policy or convenience, but, on the contrary, are inclined to leave men free to regulate their affairs as they think proper. In other words, the courts will not declare an agreement void on the ground of public policy unless it clearly appears to be in violation of the public policy of the state. A similar caution is one to the effect that before a court refuses to recognize an agreement which is made in good faith and stipulates for nothing that is malum in se or malum prohibitum it should be satisfied that the advantage to accrue to the public from its holding is certain and substantial, not theoretical or problematical. It has also been observed that the power to invalidate agreements on the ground of public policy is so far-reaching and so easily abused that it should be called into action to set aside or annul the solemn engagements of parties dealing on equal terms only in cases where the corrupt or dangerous tendency clearly and unequivocally appears upon the face of the agreement itself or is the necessary inference from the matters which are expressed, and that the only apparent exception to this general rule is to be found in those cases where the agreement, though fair and unobjectionable upon its face, is a part of a corrupt scheme and is made to disguise the real nature of the transaction.

"It is no doubt correct to say that while public policy forbids the enforcement of an illegal or immoral agreement, it is equally insistent that those which are lawful and contravene none of its rules shall be enforced and not be *789 held invalid on a bare suspicion of illegality. The fact is that since the courts are reluctant to declare an agreement void as against public policy, they will refuse to do so if by any reasonable construction the agreement can be upheld. Along this line, it is said that the paramount public policy is that freedom to contract is not to be interfered with lightly, and it is the court's duty to sustain the legality of a contract in whole or in part whenever it can do so."

(Emphasis added.)
Even so, we recognize the well-settled law in Alabama that penalty provisions are void as against public policy and that courts are "`disposed to lean against any interpretation of a contract which will make the provision one for liquidated damages and, in all cases of doubtful intention, will pronounce the stipulated sum a penalty.' " See Camelot Music, Inc. v. Marx Realty & Improvement Co., 514 So.2d 987, 990 (Ala.1987), quoting Cook v. Brown, 408 So.2d 143, 144 (Ala.Civ.App.1981).
In Williston on Contracts § 776-88 (3d ed. 1961), Professor Williston ably discusses penalty provisions in contracts:
"`[N]o fixed or settled rule can be stated by which the courts may always determine whether a stipulation for the payment of a fixed sum should be treated as a penalty.... Where Compensation for injury resulting from a breach of contract is reasonably susceptible of measurement by some adequate and approved legal standard, a stipulation providing for the payment of an amount which may easily be excessive with reference to the terms, nature, and purpose of the contract, making it a matter held in terrorem over either party, should be construed as a penalty, even though it has been specifically designated [as disincentive].'
". . . .
"The rule that a penalty provision in a contract is invalid applies with equal force to contracts with the government, where the Congress has not adopted a different standard, as it does to agreements between private parties. Where the pertinent clause in the contract with the government provides, not for a statutory penalty imposed by the sovereign as punishment for an offense, but for a sum payable in the nature of damages, the court will apply the principles of general contract law."
Id. at 670-72.
In regard to a contract as to which there appears an admission that the provision was included to serve only as an added spur to performance and not to make a fair estimate of damages to be suffered, "[i]t is well-settled contract law that courts do not give their imprimatur to such arrangements." Id. at 676.
An essential step toward understanding this matter is to recognize that "`[t]he question is not what the parties intended, but "whether the sum is in fact in the nature of a penalty."'" Id. at 682.
"`[T]he final determination of the question whether or not a stipulation should be construed as providing for a penalty [requires the courts to determine whether the stipulation provides for] "just compensation" for injury resulting from the breach of the contract, and the controlling object should be to place the injured party in as advantageous [a] position as he would have occupied had his contract not been broken. So long as the contracting parties keep this principle in view, the courts will very generally allow them to agree upon such a sum as will probably be the fair compensation for the breach of a contract. But when they go beyond this, and undertake to stipulate, not for compensation, but for a sum entirely disproportionate to the measure of liability which the law regards as compensatory, the court will refuse to give effect to the stipulation and will confine the parties to such actual damages as may be pleaded and proved.
"`In every case involving a contract providing for a fixed sum to be paid in the event of a breach, the real issue involved, therefore, is whether the contract adheres to the fundamental rule of "just compensation."' [Quoting Pembroke *790 v. Caudill, 160 Fla. 948, 37 So.2d 538 (1948).]
"In other words, calling a sum to be paid under a contract liquidated or stipulated damages will not prevent the court from treating it as a penalty."
Id. at 689-90.
"The only evidence that the court ever has before it, bearing on the issue whether the parties in good faith made such an estimate [the amount of `just compensation'], besides their statement in the contract [as to the name given to the sum to be paid] is the reasonableness in fact of the amount."
Id. at 694.
"[I]n other words, the reasonableness or unreasonableness of the stipulation is decisive.

Id. at 698.
"If the daily or weekly sum stipulated is out of proportion to any possible damage that could be caused by a delay, it will be [considered unreasonable and will be] held penal even for delayed performance."
Id. at 737-38.
"It is true on the one hand that parties should be left to make their own bargains; it is equally true that they cannot be left to do so without some limitation. It should be clear that the limit of reasonableness has been passed, before a court should set aside their contract."
Id. at 760-61.
With this theory of law in mind, we address the issue whether the disincentive provision in the contracts at issue is a penalty and therefore is void as against public policy.
It is undisputed that the contracts at issue provide for both liquidated damages and disincentive payments. It is also undisputed that the stated purpose of the incentive/disincentive payments provision of each contract was to ensure "the earliest possible date for completion of the project." In order to achieve that purpose, did the disincentive clause penalize Milton? Was the clause security for performance or was it a punishment for default?
A penalty is in essence a security for performance designed to punish one party for breach of contract, whereas a liquidated damages provision is a sum to be paid in lieu of performance (a sum that the parties agree upon as an adequate assessment of damages that would result from a possible breach). See Camelot Music, Inc. v. Marx Realty & Improvement Co., Cook v. Brown, supra; see, also, Forsyth v. Central Foundry Co., 240 Ala. 277, 198 So. 706 (1940); Standard Tilton Milling Co. v. Toole, 223 Ala. 450, 137 So. 13 (1931).

"Attempts are sometimes made to conceal the fact that the amount specified in a contract is a penalty by using words indicating that the payment is [something else]. There is a borderline along which it is difficult to determine the question; but payment of the specified amount will not be enforced if the court is convinced that it is a penalty the purpose of which was to stimulate performance of a promise to do something else."
Restatement of Contracts, § 339 at 554 (1932). (Emphasis added.)
Although Camelot Music, Inc. v. Marx Realty & Improvement Co., supra, established an analysis to determine whether a liquidated damages provision must fail as a penalty, that analysis applies equally well to a determination whether a disincentive clause must fail as a penalty. In Camelot Music, Inc., supra, we cited three criteria by which a stipulated damages clause may be characterized as liquidated damages as opposed to a penalty:
"First, the injury caused by the breach must be difficult or impossible to accurately estimate; second, the parties must intend to provide for the damages rather than for a penalty; and, third, the sum stipulated must be a reasonable prebreach estimate of the probable loss."
514 So.2d at 990, citing C. Gamble and D. Corley, Alabama Law of Damages § 5-4 (1982). If one of these three criteria is not met, the clause must fail as a penalty. Applying the three criteria to the facts of the instant case, we find that the disincentive *791 clause at issue clearly constitutes a penalty and therefore is void as a matter of public policy.
First, in each contract, the amount of injury caused by delay had already been determined, assessed, and withheld. Furthermore, any other injury that the Highway Department would suffer was addressed in the "Default Clause," which allowed recovery of "all costs and charges incurred by the [Highway] Department, together with the cost of completing the work under contract." The recovery of "all costs" by the Highway Department upon Milton's default in either the I-65 Project or in the I-59 Project, along with the additional recovery of liquidated damages for delay, would certainly "justly compensate" the Highway Department for any injury; any further compensation would pass the limit of reasonableness. Even Federal Highway Administration Advisory T5080.10 (February 8, 1989), which allows for incentive/disincentive provisions, states as follows:
"3. Background

". . . .
"d. If [a State Highway Administration] includes delay related costs in its liquidated damage rate, those delay costs should be excluded from the disincentive amount on an I/D project so a contractor is not subjected to a double assessment for the same costs."

The Highway Department failed to do this in the I-65 Project and in the I-59 Project; thus, the Highway Department received more than a double recovery for the same damages. Such compensation is totally out of proportion to the damages incurred and thus is unreasonable. In addition, according to Camelot Music, Inc., supra, the parties must actually intend, by the stipulated damages clause, to provide for damages rather than for a penalty. The evidence in the instant case revealed that the Highway Department unilaterally decided to include a disincentive clause in its contracts prior to any negotiations with Milton and prior to Milton's involvement in the I-65 or I-59 Projects. Thereafter, contractors bid on the projects with the disincentive clause included as part of the bid documents, not as a negotiated term or condition.
Furthermore, according to the complaint, the clear language of each contract indicates that the purpose of the disincentive clause was to encourage early completion of the contract"the contractor's attention is directed to the fact that it is in the public's interest to complete this project at the earliest possible date"and not as compensation for any delay caused to the Highway Department or to the public. Therefore, the disincentive clause clearly acts as a discouragement or penalty for late completion. Thus, the Highway Department is using the disincentive clause as security for the performance of the contract through acts of financial punishment, a result that Alabama law does not allow. See Camelot Music, Inc., supra; and Standard Tilton Milling Co., supra.
The third criterion set forth in Camelot Music, Inc., supra (that the stipulated sum must be reasonable) is applied after the fact and measures whether the sum stipulated did in fact reasonably approximate the actual injury that previously was unascertainable; in essence, whether the disincentive clause bears a rational relation to the injury incurred. The Highway Department concedes that it arbitrarily set the dollar amount of the per-day assessment and the maximum time limit for the assessment in the disincentive clause. From our review of the record, we conclude that these arbitrary calculations had no correlation to the damages that the Highway Department sustained; therefore, considering the fact that liquidated damages had already been assessed and withheld from Milton, we must conclude that the disincentive clause does not compensate for the injury that occurred, but rather attempts to coerce performance and results in disproportionate, unreasonable compensation. Such a purpose is penal in nature and is therefore invalid.
Based on the foregoing, we hold that the trial court erred in failing to declare the disincentive clause void as a penalty and therefore unenforceable.
*792 The Highway Department contends that, because Milton had previously received incentive compensation pursuant to the incentive/disincentive payments provision, it is estopped from asserting that the disincentive clause of that provision is void.
In the instant case, the validity of the incentive clause of the provision is not at issue. Rather, the essence of the Highway Department's argument seems to be that the presence of the incentive clause in the incentive/disincentive payments provision and Milton's acceptance of bonus compensation pursuant to that provision in a previous contract estops Milton from asserting that the disincentive clause of the incentive/disincentive provision is a penalty. We disagree.
"The doctrine of estoppel ... is a principle of equity that operates not to create a right nor to impose an obligation, but to prevent an otherwise unjust result. Indeed, it proceeds on the absence of such right or obligation, and comes into play where a party takes a position in one instance inconsistent with that party's position in another instance, to another's prejudice. [Citations omitted.]
"`The purpose of equitable estoppel is to promote equity and justice in an individual case by preventing a party from asserting rights under a general rule of law when his own conduct renders [that assertion] contrary to equity and good conscience.' [Citations omitted.]"
Williams v. FNBC Acceptance Corp., 419 So.2d 1363, 1367 (Ala. 1982).
Milton does not, nor did it ever, contend that the payment of an incentive for early completion was not valid. What it does contend, however, is that the withholding of disincentive payments for late completion is a void and unenforceable penalty. Milton's position concerning incentive payments for early completion is not inconsistent with its position concerning disincentive amounts withheld for late completion; Milton's contentions are not contrary to equity and good conscience.
Furthermore, in Standard Chemical Co. v. Barbaree, 239 Ala. 601, 195 So. 892 (1940), we held that "[i]t is generally considered that as between parties to a contract, validity cannot be given to it by estoppel if it is prohibited by law or is against public policy." Likewise, in the instant case, we hold that as between Milton and the Highway Department, validity cannot be given to the disincentive clause of the incentive/disincentive payments provision by estoppel, because the disincentive clause is against public policy.
We also note Milton's contention that the trial court erred in failing to strike an affidavit that Milton says contained unqualified opinion and hearsay testimony. Because of our resolution of the casethat the disincentive clause of the contract provides for a penalty and thereby is void and unenforceable, as a matter of public policywe pretermit any discussion of this issue.
Therefore, we reverse the judgment and remand the cause for further proceedings consistent with this opinion.
REVERSED AND REMANDED.
HORNSBY, C.J., and JONES, SHORES and KENNEDY, JJ., concur.
NOTES
[1]  The I-65 Project was a contract that Milton entered into with the Highway Department for the construction of Federal Aid Interstate Project Number I-65-2 (106) 256 in Jefferson County, Alabama.
[2]  The I-59 Project was a contract that Milton entered into with the Highway Department for the construction of Federal Aid Interstate Project Number ACIR-59-1 (156) 119 in Jefferson County, Alabama.
[3]  The incentive/disincentive payments provision in the I-65 Project is found in Special Provision No. 924 and in the I-59 Project is found in Special Provision No. 1320.
[4]  The liquidated damages provisions in the two contracts are identical, except as to amount; the liquidated damages amount specified in the I-65 Project was $600 per day and the liquidated damages amount specified in the I-59 Project was $450 per day.
