
587 N.W.2d 369 (1998)
255 Neb. 726
Dennis D. SCHUELKE, Appellant,
v.
David L. WILSON, Appellee.
No. S-97-827.
Supreme Court of Nebraska.
December 11, 1998.
*372 Terry K. Barber, Lincoln, for appellant.
Mark J. Peterson, of Erickson & Sederstrom, P.C., Omaha, for appellee.
HENDRY, C.J., and WRIGHT, CONNOLLY, GERRARD, McCORMACK, and MILLER-LERMAN, JJ.
MILLER-LERMAN, J.
Dennis D. Schuelke appeals a judgment of the Lancaster County District Court, ordering him to pay David L. Wilson $268,607 plus interest, in connection with two promissory notes which Schuelke executed in favor of Wilson for the purchase of a business. We affirm.

STATEMENT OF FACTS
In October 1989, Schuelke entered into a contract with Wilson for the purchase of a Maaco automobile painting business that Wilson had owned in Lincoln, Nebraska, since 1980. The sales agreement between Schuelke and Wilson was the product of at least 4 months of discussion between the parties. The purchase price upon which they agreed was $250,000. Schuelke paid Wilson $140,000 in cash at the time of purchase. Schuelke executed two promissory notes in favor of Wilson to finance the remainder of the purchase price.
Schuelke executed both promissory notes on October 6, 1989. One note was in the principal amount of $65,000. The first payment on this note was $15,000, due on June 12, 1991. This note provided that interest would accrue at the rate of 16 percent per annum on all overdue installment payments. The second promissory note was for the principal sum of $45,000, all of which was due and payable on October 6, 1994. The second note also provided for interest accruing on unpaid sums due and owing at the rate of 16 percent per annum.
Schuelke assumed operation of the Maaco business in mid-October 1989. Within less than a month, Schuelke sent a letter to Wilson, stating that he desired to rescind the sales contract. Schuelke claimed that Wilson had materially misrepresented, inter alia, the revenue and operating costs of the Maaco business in order to induce Schuelke to purchase it. Wilson refused to consent to Schuelke's request to rescind the contract.
Schuelke operated the Maaco business from October 1989 through June 1990, at which time he closed and abandoned the business premises. Maaco Enterprises, Inc., which authorized Schuelke to operate the Lincoln business, terminated his franchise agreement.
Schuelke filed an action against Wilson in the district court for Lancaster County on January 12, 1990, to compel rescission of the sales contract. Wilson counterclaimed, alleging that he was entitled to an award of damages occasioned by Schuelke's default on the terms of the two promissory notes, by Schuelke's failure to continue operating the Maaco business, by Schuelke's sale without notice to Wilson of collateral that Schuelke had pledged to secure his debt to Wilson, and by Schuelke's filing of the action seeking rescission of the sales contract. Schuelke denied Wilson's counterclaim, and he affirmatively alleged that Wilson's right to recover on the promissory notes was barred by a failure of consideration, as well as Wilson's alleged fraudulent representations to Schuelke, which were described in detail in Schuelke's petition seeking rescission of the contract. The parties' claims against each *373 other were tried to the court during an 8-day trial in late 1992. In an order filed on October 8, 1993, the trial court ordered rescission of the sales contract between Schuelke and Wilson on the basis of fraudulent misrepresentation.
On appeal, in Schuelke v. Wilson, 250 Neb. 334, 549 N.W.2d 176 (1996), this court reversed the trial court's rescission order. We found that Schuelke had failed to prove by clear and convincing evidence that Wilson intended for Schuelke to rely upon certain representations, and we further held that Schuelke's reliance upon these representations was neither justified nor undertaken in an ordinary and prudent manner. We concluded Schuelke by reversing the rescission order entered by the trial court and remanding the cause to the trial court to address Wilson's counterclaim for payment of the promissory notes.
On remand, the district court conducted a trial of Wilson's counterclaim for payment of the promissory notes on February 5, 1997. In a brief hearing, counsel for the parties agreed that the trial court could decide the counterclaim based upon the evidence submitted in the 1992 trial of Schuelke's rescission claim, all of which was contained in the 10-volume bill of exceptions submitted on appeal in Schuelke. The parties jointly introduced one new exhibit, a stipulation signed by counsel for both parties which stated that as of the date of trial, no money payments had been made by Schuelke to Wilson to satisfy either of the promissory notes executed by Schuelke in favor of Wilson.
In an order filed on May 29, 1997, the trial court noted that with the exception of the parties' written stipulation that no money payments had been made by Schuelke to Wilson on the promissory notes, no evidence submitted on remand was "materially and substantially different from the evidence considered by the Supreme Court in Schuelke [v. Wilson, 250 Neb. 334, 549 N.W.2d 176 (1996) ]." On the basis of the law-of-the-case doctrine, the trial court held that Wilson was entitled to payment by Schuelke of $268,607, plus interest accruing on the judgment at the rate of $75.98 per day from and inclusive of February 6, 1997, the day after the trial on Wilson's counterclaim. Schuelke appeals.

ASSIGNMENTS OF ERROR
Schuelke claims, restated, that the trial court erroneously failed to consider, and to find, that Schuelke's "legal" defenses to Wilson's claim for payment of the promissory notes were valid and precluded the judgment rendered against him for default on the promissory notes.

STANDARD OF REVIEW
A suit for damages arising from breach of a contract, including breach of the terms of a promissory note, presents an action at law. Production Credit Assn. v. Eldin Haussermann Farms, 247 Neb. 538, 529 N.W.2d 26 (1995). In a bench trial of a law action, a trial court's factual findings have the effect of a jury verdict and will not be set aside unless clearly erroneous. Richardson v. Mast, 252 Neb. 114, 560 N.W.2d 488 (1997).

ANALYSIS
Schuelke's assigned errors regarding his "legal" defenses to Wilson's claim for damages due to Schuelke's default on the notes necessitate that we commence our analysis by distinguishing the nature of the claims asserted by the parties against each other.
Schuelke initiated this action by seeking rescission of his contract with Wilson for the purchase of the Maaco business. An action for rescission sounds in equity, and it is subject to de novo review upon appeal. Schuelke v. Wilson, 250 Neb. 334, 549 N.W.2d 176 (1996). In a rescission case, a party alleging fraud as the basis for rescission must prove all of the elements of the fraudulent conduct by clear and convincing evidence. Id., relying on Kracl v. Loseke, 236 Neb. 290, 461 N.W.2d 67 (1990).
Wilson counterclaimed against Schuelke for an award of money damages based upon Schuelke's breach of two promissory notes. Wilson's counterclaim constituted an action at law. It required proof by only a preponderance of evidence, as opposed *374 to the higher "clear and convincing" standard necessary in an equitable fraud action. Schuelke, supra. Factual findings in judgments in law actions tried to the bench are generally affirmed on appeal unless they are determined to be clearly erroneous. Richardson v. Mast, supra.
While Schuelke's claim against Wilson was equitable in nature and Wilson's counterclaim against Schuelke was an action at law, the two claims nonetheless were capable of existing in the same suit. A counterclaim may be asserted by a defendant against a plaintiff in the same action where, inter alia, the counterclaim arises from the same contract or transaction set forth in the plaintiff's petition as the foundation of the plaintiff's claim. Neb.Rev.Stat. §§ 25-812 and 25-813 (Reissue 1995). See, also, Klitzing v. Didier, 215 Neb. 122, 337 N.W.2d 418 (1983).
After the trial court's order granting rescission was reversed by this court in Schuelke, supra, Wilson's counterclaim against Schuelke for payment on the notes was the sole matter in need of resolution upon remand. The parties stipulated on remand that the trial court could consider all of the evidence introduced at the first trial in lieu of introducing live testimonial evidence. The evidence before the court at the hearing on remand thus consisted entirely of the record from the first trial, except for the written stipulation introduced by the parties that Schuelke had made no money payments on the notes to Wilson as of the date of the second trial. As noted above, the trial court subsequently entered judgment in Wilson's favor.
In Wilson's brief, he inaccurately claims that the trial court's order in his favor must be affirmed because in Schuelke, this court "dismissed the basis of Schuelke's claims and merely requested that the District Court calculate the exact amount of the judgment to be entered against Schuelke given that the [sales] contract between the parties is wholly enforceable." Brief for appellee at 10. In fact, we made no findings in Schuelke regarding either the merits of Wilson's claim for damages against Schuelke on the promissory notes or the amount of those damages, if any. In Schuelke, this court determined merely that Schuelke had failed to prove by clear and convincing evidence that Wilson had fraudulently misrepresented the Maaco business and, thus, that Schuelke had failed to prove that rescission of the contract was warranted. On remand, Wilson therefore was obligated to proceed on his counterclaim in effect, as the plaintiff, carrying the burden of proof as to his entire claim for liability and damages against Schuelke for breach of the two promissory notes. See Klitzing v. Didier, 215 Neb. at 126, 337 N.W.2d at 421 (holding that where claim by plaintiff dismissed, defendant would proceed on counterclaim "in effect, [as] plaintiff").
In his timely filed answer to Wilson's counterclaim, Schuelke specifically alleged the defenses of failure of consideration and Wilson's alleged fraudulent misrepresentation in inducing Schuelke to execute the sales contract and promissory notes. Matters which seek to avoid a valid contract are affirmative defenses, and the burden of proving an affirmative defense rests upon the party alleging the defense. Production Credit Assn. v. Eldin Haussermann Farms, 247 Neb. 538, 529 N.W.2d 26 (1995). Failure of consideration is an affirmative defense, which Schuelke was obligated to plead or else forgo as a basis of defense. See Larsen v. First Bank, 245 Neb. 950, 515 N.W.2d 804 (1994).
At the trial on remand, as well as in this appeal, Schuelke claims generally that the condition of the Maaco business he bought from Wilson was so deficient that it failed to constitute meaningful consideration for the promissory notes executed in connection with the purchase. Specifically, Schuelke alleged that the business' equipment was "`old and moldy'" at best and, in some instances, nonexistent. Brief for appellant at 8. Schuelke further claimed that unbeknownst to him, Wilson depleted the business' inventory immediately prior to Schuelke's purchase by conducting a paint sale. Schuelke also claimed that the Maaco business' financial status was much less stable than Wilson had represented it to be.
Wilson asserts in the case at bar that our findings in Schuelke v. Wilson, 250 Neb. 334, *375 549 N.W.2d 176 (1996), precluded Schuelke, on remand, from introducing evidence to support any and all of the affirmative defenses Schuelke pled in response to Wilson's prayer for enforcement of the promissory notes. Wilson argues that this is so based on the doctrines of res judicata and the law of the case. Wilson misperceives the effect of Schuelke.
With respect to Wilson's reliance on res judicata, we observe that under the traditional rule of res judicata, sometimes called claim preclusion,
any rights, facts, or matter in issue directly adjudicated or necessarily involved in the determination of an action before a competent court in which a judgment or decree is rendered upon the merits is conclusively settled by the judgment therein and cannot again be litigated between the parties and privies.
Hickman v. Southwest Dairy Suppliers, Inc., 194 Neb. 17, 20, 230 N.W.2d 99, 102 (1975). In the first trial, which culminated in our ruling in Schuelke, supra, neither the trial court nor this court rendered findings of fact or conclusions of law pertaining to the merits of Wilson's counterclaim raising Schuelke's alleged breach of the promissory notes or of the merits of Schuelke's affirmative defense thereto. Neither Wilson's counterclaim nor Schuelke's affirmative defenses are res judicata. The elements of proof in Schuelke's initial claim against Wilson for rescission based upon fraudulent misrepresentation and Wilson's counterclaim against Schuelke for breach of contract are not the same, and claim preclusion was properly not invoked by the trial court upon remand to bar Schuelke's presentation of evidence in support of his affirmative defense to Wilson's counterclaim alleging default on the notes. See, e.g., Lincoln Lumber Co. v. Fowler, 248 Neb. 221, 533 N.W.2d 898 (1995) (holding that where elements of proof differ between causes, judgment in one action may, but does not necessarily, preclude judgment in another, factually related action).
With respect to the doctrine of the law of the case, we observe that in its decision awarding Wilson damages for Schuelke's breach of the two promissory notes, the trial court upon remand properly relied upon the law of the case established in Schuelke. Matters which have been expressly adjudicated in prior proceedings become the law of the case on remand, and such matters will not be considered again unless it is shown that the facts presented at the second trial are materially and substantially different from the facts presented at the first trial. State v. Jacob, 253 Neb. 950, 574 N.W.2d 117 (1998), cert. denied ___ U.S. ___, 119 S.Ct. 219, 142 L.Ed.2d 180. The burden of showing a material and substantial difference in the facts is on the party asserting the difference, in order to avoid the effect of the law of the case created as a result of the prior proceedings. Id., relying on Tank v. Peterson, 228 Neb. 491, 423 N.W.2d 752 (1988).
At trial on remand, Schuelke and Wilson each elected to rely, with the exception of the stipulation of nonpayment, upon the written record of evidence introduced in the first trial. Wilson offered the prior evidence in order to prove his counterclaim for breach of contract and damages, and Schuelke offered it to prove his affirmative defenses. In doing so, each party forwent the opportunity to present new evidence to demonstrate a material and substantial change in the facts. Given our opinion in Schuelke v. Wilson, 250 Neb. 334, 549 N.W.2d 176 (1996), and the ensuing trial upon remand, the trial court was justified in relying upon the law of the case to the extent set forth in Schuelke. See, also, State v. Jacob, supra.
Upon remand, the trial court correctly found that one of Schuelke's affirmative defenses, that Wilson fraudulently misrepresented the matters material to the contract, failed because of the law of the case articulated in Schuelke. As noted above, in Schuelke, this court expressly found that Wilson had not fraudulently misrepresented any matter pertaining to the sales contract from which the promissory notes were generated. Thus, the sole remaining basis upon which Schuelke could avoid liability for his failure to pay on the promissory notes was the affirmatively pled *376 defense of failure of consideration. The trial court found insufficient proof of failure of consideration, a finding amply supported by the record.
Failure of consideration occurs where, inter alia, the purpose of the parties' agreement or contract wholly fails. For example, in Cotner College v. Estate of Hester, 155 Neb. 279, 281, 51 N.W.2d 612, 614 (1952), a case relied upon by Schuelke, this court found that the consideration for a testamentary "endowment note" intended by the decedent to fund religious education scholarships at a seminary in Bethany, Nebraska, failed and could not be enforced because the seminary had changed locations and it no longer offered the course of instruction for which the scholarships were expressly intended. Failure of consideration is an affirmative defense to enforcement of a contract which may be proved in law cases, Blaha GMC-Jeep, Inc. v. Frerichs, 211 Neb. 103, 317 N.W.2d 894 (1982), as well as in equity cases, Eliker v. Chief Indus., 243 Neb. 275, 498 N.W.2d 564 (1993). In the instant claim for damages for breach of contract, the burden of proving failure of consideration was upon Schuelke, the party asserting it as an affirmative defense. See Production Credit Assn. v. Eldin Haussermann Farms, 247 Neb. 538, 529 N.W.2d 26 (1995).
Generally, sufficient consideration for an agreement will be found if there is some benefit to one of the parties or a detriment to the other. Valuable consideration for a contract, including a promissory note, "'"`need not be one translatable into dollars and cents[.]'"'" Hyde v. Shapiro, 216 Neb. 785, 788, 346 N.W.2d 241, 243 (1984). Sufficiency of consideration is not dependent upon a contracting party's realization of the profit or gain which he or she expected as a result of the contract. It has been stated:
The motive to contract and the consideration for the contract are distinct and different. 1 S. Williston, A Treatise on the Law of Contracts § 111 (3d ed.1957). "An expectation of results often leads to the formation of a contract, but neither the expectation nor the result is `the cause or meritorious occasion requiring a mutual recompense in fact or in law.'" Philpot v. Gruninger, 81 U.S. 570, 577 (14 Wall.), 20 L.Ed. 743 (1871). Parties are led into agreement by many inducements, such as the hope of profit, the expectation of acquiring what they could not otherwise obtain. These inducements are not legal or equitable considerations, and compose no part of a contract. See 17 Am.Jur.2d Contracts § 93 (1964).
Hyde v. Shapiro, 216 Neb. at 790-91, 346 N.W.2d at 245.
In the case at bar, Schuelke assumed the ownership and operation of the Maaco business in mid-October 1989. There is no evidence in the record that Wilson impeded Schuelke's possession or operation of the business for a profit or that the business was not in active operation when Schuelke purchased it. Schuelke operated the business until June 1990, when he closed and abandoned it. The record contains no evidence that Wilson or any other party forced or induced Schuelke to close and abandon the Maaco business. Schuelke testified that when he did so, he simply left behind all of the business equipment, except for some paint.
It is the law of the case that Schuelke failed to prove facts which entitled him to rescission of the sales contract. See Schuelke v. Wilson, 250 Neb. 334, 549 N.W.2d 176 (1996). While there is evidence in the record that Schuelke lost money during his operation of the Maaco business, the record is devoid of proof that Wilson failed to perform his contractual duty to transfer title and ownership of the Maaco business to Schuelke. The fact that the business failed to generate profit in the manner and time anticipated by Schuelke does not, on the facts of this case, amount to a failure of consideration for the contract.
The case Nathan v. McKernan, 170 Neb. 1, 101 N.W.2d 756 (1960), provides useful guidance in evaluating Schuelke's affirmative defense. In Nathan, after considerable negotiation, the buyers purchased a meat locker business, including the locker itself, from the seller. Soon after assuming ownership and operation of the business, the buyers *377 claimed, inter alia, that the locker's physical facilities were grossly defective and that the business was without an adequate customer base, all contrary to the seller's representations during sales negotiations. Like the instant case, the seller in Nathan had financed the buyers' purchase of the business and the buyers operated the business for a relatively short period of time and then "`turned the key and walked away.'" 170 Neb. at 15, 101 N.W.2d at 766.
The buyers in Nathan defaulted on their repayment obligation and sought to avoid the seller's claim for damages by asserting the defense of failure of consideration. On appeal, this court declined to find a failure of consideration, stating:
"As a general rule there is an entire failure of consideration where the property purchased is entirely worthless.... [T]here is not a failure of consideration if the property is not entirely worthless, or if it has any substantial value, although less than the consideration paid ... as where, by reason of some unsoundness or imperfection, it is merely diminished in value...."
(Emphasis supplied.) Nathan v. McKernan, 170 Neb. at 16, 101 N.W.2d at 766. See, also, 77A C.J.S. Sales § 27b (1994).
The evidence contained in the record suggests that the gravamen of Schuelke's defense of failure of consideration is, at best, a claim that the Maaco business had higher operating costs than he had anticipated and that it failed to generate profits in the manner that he had hoped it would. Such facts do not rise to the level of failure of consideration. The trial court properly considered all of Schuelke's defenses, and its conclusion that Schuelke failed to demonstrate failure of consideration is supported by the record. The court's order awarding damages to Wilson for Schuelke's breach of the two promissory notes is correct and is affirmed.
Wilson has moved this court for an award of attorney fees on appeal pursuant to Neb.Rev.Stat. § 25-824 (Reissue 1995), claiming that Schuelke's appeal is frivolous. Wilson did not seek attorney fees at the second trial before the district court, and no attorney fees or costs were assessed against Schuelke. An appellate court may award attorney fees on appeal regardless of whether they were requested or ordered in the trial court. Foiles v. Midwest Street Rod Assn. of Omaha, 254 Neb. 552, 578 N.W.2d 418 (1998).
In support of his request for attorney fees, Wilson asserts that Schuelke's instant appeal is frivolous because of our holding in Schuelke, supra. Wilson further notes in his appellate brief that Schuelke's burden in this appeal is difficult, given the standard of review.
For purposes of § 25-824, "frivolous" means an attempt to relitigate the same issues resolved in prior proceedings with the same parties, see Cedars Corp. v. Sun Valley Dev. Co., 253 Neb. 999, 573 N.W.2d 467 (1998), or a legal position wholly without merit, that is, without rational argument based on law and evidence to support a litigant's position, see Foiles v. Midwest Street Rod Assn. of Omaha, supra. Any doubt as to whether a legal position is frivolous should be resolved in favor of the party whose legal position is in question. Id.
Following our review of the record, we observe that Schuelke did not take a frivolous approach either to the trial on Wilson's counterclaim for damages or on appeal. Although Schuelke's defense and appeal ultimately failed, Schuelke's approach to the litigation was not frivolous. Wilson's motion for attorney fees on appeal is denied.

CONCLUSION
We affirm the trial court's order awarding Wilson damages for breach of the promissory notes. Wilson's motion for attorney fees on appeal is denied.
AFFIRMED.
STEPHAN, J., not participating.
