
903 P.2d 1321 (1995)
127 Idaho 624
David Lamar KELLY and Annette W. Kelly, Plaintiffs-Appellants-Cross Respondents,
v.
SILVERWOOD ESTATES, a Utah Partnership, Howard McDonald, Joseph S. McDonald, Steven McDonald, and McDonald Brothers, Inc., Defendants-Respondents-Cross Appellants.
No. 21103.
Supreme Court of Idaho, Twin Falls, March 1995 Term.
September 28, 1995.
*1323 Parsons, Smith, Stone & Fletcher, Burley, for appellants. Randolph C. Stone argued, Burley.
Donald J. Chisholm, Burley, for respondents.
SCHROEDER, Justice.

I.

BACKGROUND AND PRIOR PROCEEDINGS
On January 2, 1985, Silverwood Estates (Silverwood), a Utah partnership, entered into a contract with David LaMar Kelly and Annette W. Kelly (the Kellys) to acquire a one-half interest in K5 Ranch which consisted of deeded real estate located in Idaho and Utah, plus irrigation and farm equipment, livestock and grazing rights. The Kellys were the record owners of the realty and also held the K5 brand. Although this property was never formally transferred to the K5 partnership, the Kellys do not dispute that the brand and the realty were partnership assets.
At the time the partnership was formed, the Kellys agreed that their interest in the K5 Ranch partnership would be encumbered by their preexisting obligations in the approximate amount of $550,000. Additionally, the Kellys' debts were refinanced with a loan from Moore Financial of Utah, Inc. (now known as West One Bank) in the amount of $510,000. Silverwood was required to sign the loan as guarantor, and all of the partnership's real property was encumbered to secure the Kellys' loan that was refinanced.
On June 1, 1988, the Kellys advised Silverwood that they were withdrawing from the partnership. This effected a dissolution of the partnership as of that date. Idaho Code § 53-331(1)(b).[1] Silverwood took sole possession of the partnership assets with the exception of about half of the livestock which the Kellys took on October 1, 1988. David Kelly testified that on several occasions after June 1 the Kellys attempted unsuccessfully to negotiate a winding up of the partnership with Silverwood, and that Silverwood's continuation of the partnership business was without the Kellys' consent.
As of the date of dissolution the Kellys owed West One Bank $627,301 in principal and interest on the debt consolidation loan which was secured by the partnership realty and guaranteed by Silverwood. On May 17, 1989, the Kellys filed a bankruptcy petition. The bankruptcy trustee issued a general order of abandonment finding that the Kellys had no equity in the real property securing the West One Bank debt either directly or indirectly through the K5 partnership. The Kellys received a discharge in bankruptcy on September 5, 1989, which included discharge of their debt to West One. Silverwood became *1324 obligated on the debt as a consequence of the guarantee, and the debt encumbered the real property of the partnership.
On October 24, 1989, the Kellys made a written demand upon Silverwood for the sum of $99,405 which they claimed represented half of the partnership assets as of June 1, 1988. They based the amount of their settlement demand on their mistaken belief that the partnership realty had been lost through foreclosure by West One Bank.
On January 10, 1990, the Kellys filed an action for a decree of dissolution,[2] a formal accounting,[3] a wind up of partnership affairs,[4] and a distribution of their rightful share of the partnership assets. Silverwood counter-claimed for $35,800, the amount it believed the Kellys received from the sale of the partnership livestock they took in October of 1989. Silverwood also alleged that the Kellys had no equity in the K5 partnership as of June 1, 1988.
Following commencement of the action, the remaining livestock were sold and the proceeds of the sale deposited with the court. By stipulation of the parties, $32,909.27 of the proceeds was applied to a portion of the Kellys' debts, and $15,047 was applied to a partnership obligation to Farm Credit Leasing Services, Corp.
The partnership's realty was listed for sale at a price of $825,000, pursuant to stipulation of the parties. However, there were no offers, and the parties were advised by realtors they consulted that the price should be lowered to between $500,000 and $550,000.
On October 11, 1991, Silverwood negotiated with West One Bank to reduce to $220,000 the mortgage indebtedness on the partnership real property, which by then had reached $779,272. A down payment of $220,000 was paid from the registry of the court.
The district court found that on the date of dissolution the Kellys were obligated to the partnership in the amount of $716,878, including the $627,301 owed West One Bank on the debt consolidation loan which became the partnership's obligation when the Kellys were unable to pay the debt and were discharged in bankruptcy. The court also found that if the Kellys had paid all obligations owed to the partnership on June 1, 1988, they would have had a negative equity of $388,623.50, and Silverwood would have had a positive equity of $431,313.50. This finding was based on contemporaneous accounting records kept by the partnership bookkeeper and a realty valuation of less than $600,000.
The district court concluded that the Kellys had no equity in the K5 partnership as of the date of dissolution. As a result Silverwood was not required to liquidate the partnership assets, and the Kellys were not entitled to rental income or a set-off for Silverwood's alleged post-dissolution waste of the partnership assets. Further, Silverwood was entitled to recoupment from the Kellys for all debts owed by them to, or for, the partnership as of the date of dissolution, despite the discharge of their obligations in bankruptcy. The court concluded that the recoupment could be had through a withholding from the Kellys of partnership assets of equal value. The court also concluded that the Kellys were not entitled to share in the "buy-down" of the West One Bank mortgage because it occurred after dissolution. Finally, the court concluded that the Kellys' no-equity status continued from the date of dissolution through the final accounting.


*1325 II.

THE TRIAL COURT CORRECTLY DETERMINED THAT THE KELLYS HAD NO EQUITY ON THE DATE OF DISSOLUTION
The trial court conducted a detailed analysis of the financial condition of the partnership as of June 1, 1988, and determined that the Kellys had no equity in the partnership, finding instead that they had a negative equity of an amount in excess of $300,000. The Kellys dispute some of the obligations attributed to them in this determination. However, the evidence established that they were obligated to the partnership in the amount of $627,301 as a consequence of the West One loan to them which became the obligation of the partnership by reason of the partnership's guarantee of that loan. That amount in and of itself placed them in a negative equity status with relation to the partnership. More than three years after the date of dissolution Silverwood negotiated a reduction of the indebtedness to the bank in the amount of $220,000 instead of the amount in excess of $600,000. The trial court correctly determined that the Kellys were not entitled to the benefit of this reduction.

III.

THE TRIAL COURT PROPERLY AWARDED ALL OF THE PARTNERSHIP ASSETS TO SILVERWOOD BASED ON ITS FINDING THAT THE PLAINTIFFS HAD NO EQUITY AT THE TIME OF DISSOLUTION
Dissolution of a partnership "is the change in the relation of the parties caused by any partner ceasing to be associated in the carrying on as distinguished from the winding up of the business." Idaho Code § 53-329. Withdrawal of one partner constitutes dissolution of the partnership. Idaho Code § 53-331; Elliot v. Elliot, 88 Idaho 81, 396 P.2d 719 (1964). Dissolution of the K5 Ranch partnership occurred on June 1, 1988, when the Kellys voluntarily withdrew from the partnership. Silverwood remained in possession of the partnership assets. Idaho Code § 53-333 sets forth the general effect of dissolution on the authority of a partner, generally terminating the authority of a partner to act for the partnership except as necessary to wind up the partnership or complete unfinished transactions. A partner who has not wrongfully dissolved the partnership has the right to wind up partnership affairs, and any partner may obtain winding up by the court. Idaho Code § 53-337. Generally, winding up is accomplished by an accounting and a liquidation of the partnership assets. 59 Am. Jr.2d, Partnership § 1100.
The Kellys maintain that they were entitled to have a winding up and distribution of the assets pursuant to Idaho Code § 53-338:
Rights of partners to application of partnership property.
1. When dissolution is caused in any way, except in contravention of the partnership agreement, each partner, as against his copartners and all persons claiming through them in respect of their interests in the partnership, unless otherwise agreed, may have the partnership property applied to discharge its liabilities, and the surplus applied to pay in cash the net amount owing to the respective partners. But if dissolution is caused by expulsion of a partner, bona fide under the partnership agreement and if the expelled partner is discharged from all partnership liabilities, either by payment or agreement under section 53-336, paragraph 2, he shall receive in cash only the net amount due him from the partnership.
Arnold v. Burgess, 113 Idaho 786, 791, 747 P.2d 1315, 1320 (Ct.App.1987) describes the ordinary process that will occur:
Ordinarily in any action to terminate a partnership the trial court will order liquidation of the partnership assets by sale, with application of the proceeds according to the priorities set forth in Idaho Code § 53-340. See, e.g., Dunn v. Baugh, 95 Idaho 236, 506 P.2d 463 (1973). *1326 The trial court departed from the ordinary process described in Arnold, supra, and the question is whether that was appropriate under the circumstances of this case.
At the threshold it is clear that one of the primary purposes contemplated by Idaho Code § 53-338 did not exist so far as the Kellys are concerned. That is, a partner "may have the partnership property applied to discharge its [the partnerships'] liabilities ..." I.C. § 53-338. In view of the personal liability of partners for partnership debts in excess of partnership assets the provision to apply partnership assets to partnership debts can be a significant protection to the partner. That rationale does not exist in this case, since the Kellys had secured a discharge of any debts in bankruptcy. There was no danger that they would be burdened personally with partnership debts. In fact when they secured the protection of the bankruptcy proceedings their personal obligation to West One Bank was discharged and became the obligation of Silverwood secured by the partnership property.
Another purpose of Idaho Code § 53-338 is to pay to the partners the surplus of any amount from the liquidation of the assets of the partnership. That raises the question of whether the trial court correctly determined the equity status of the partners as being the date of dissolution or whether the trial court should have used a later date as the time to value assets and liabilities when the obligation to West One had been reduced to $220,000. The Kellys' default on their personal obligation to West One Bank made that an obligation of Silverwood secured by the partnership property. As of that date the Kellys had a significant negative equity. There would have been nothing payable to them. Subsequently, Silverwood negotiated a substantial reduction in that obligation which might have created a positive equity if a date subsequent to the debt reduction was used. The trial court used the date of dissolution as the time to value assets and liabilities. Under the circumstances of this case that determination was correct:
The ultimate goal of the accounting is to ascertain the value of a plaintiff's interest in the partnership as of the date of dissolution and then to determine any profits attributable to the use of the plaintiff's right in the property of the dissolved partnership. Timmermann v. Timmermann, 272 Or. 613, 538 P.2d 1254 (1975).
Arnold v. Burgess, 113 Idaho at 791, 747 P.2d at 1320 (emphasis added).
The bankruptcy trustee determined that there was no value in the Kellys' interest in the partnership property. The trial court made the same determination, using the date of dissolution. This factual determination is clearly correct. Consequently there could be no "profits attributable to the use of the plaintiff's right in the property of the dissolved partnership." Id.
This case does not fall within the pattern generally contemplated by the Uniform Partnership Act in winding up and termination of a partnership. The Uniform Partnership Act anticipates that a withdrawn partner will have some value in the assets of the partnership. Idaho Code § 53-338 speaks in terms of distributing "the surplus" in cash to the partners after the debts of the partnership have been paid. Had the partnership property been sold on the date of dissolution, the Kellys' indebtedness to the partnership would have exceeded their interest in the assets of the partnership. Idaho Code § 53-342 contemplates that a retiring partner in a business that continues will have the option to receive either the value of his or her interest at the date of dissolution, plus interest as a creditor or the profits attributable to continuing use of the retired partners' interest in the property. Again, the Kellys had a negative equity. No interest could accrue on a negative equity.
The parties attempted to wind-up by selling the property. Unfortunately, the property was not worth what they believed. The stipulation they reached for sale could not be effectuated. Ultimately the trial court determined to resolve the parties' rights by a distribution in kind. As a consequence of the Kellys' bankruptcy they walked away debt free. Silverwood retained the property subject to the partnership debts.
*1327 The trial court made a best effort to follow the customary procedure of winding up by liquidation of the property. The lack of a realistic market for the partnership property defeated that effort. The trial court could have plunged ahead and required a bargain basement sale of the property, but that would have served no purpose except procedural nicety. The only way the Kellys could have acquired any equity value in the partnership property was if they were entitled to the reduction, or "buy down" of the West One claim which was negotiated by Silverwood some three years after the dissolution. The record does not show why West One agreed to the reduction, but it is clear that the Kellys had no part in securing that reduction. That came about as a result of the efforts of Silverwood. The Kellys were not entitled to the benefits of that "buy down." Whatever leverage Silverwood had to secure that benefit, that leverage was personal to it. That was the determination of the trial court, and there is nothing that would indicate that determination was incorrect.
Under the limited circumstances of this case, the decision of the trial court to distribute the assets in kind rather than to liquidate them is consistent with the purposes of the Uniform Partnership Act. The Kellys got exactly what they sought when they dissolved the partnership and sought the protection of the bankruptcy court. They left the operation of the partnership behind and emerged debt free. No benefit to which they were entitled was generated by use of the partnership property. They could only benefit if they received a debt reduction that was personal to Silverwood. The trial court determined the Kellys were not entitled to the benefit of the debt reduction. The determination of the trial court is affirmed.

IV.

THE TRIAL COURT DID NOT ERR IN AWARDING COSTS TO THE DEFENDANT AS THE PREVAILING PARTY
A determination of which party is the prevailing party for purposes of awarding costs is within the sound discretion of the trial court. I.R.C.P. 54(d)(1)(B). A review of the trial court's determination is limited to whether the court abused its discretion. In making that determination, this Court considers whether the trial court acted within the outer boundaries of its discretion and consistently with the legal standards applicable to the specific choices available to it, and whether the court reached its decision by the exercise of reason. Farm Credit Bank v. Wissel, 122 Idaho 565, 568, 836 P.2d 511, 514 (1992).
In concluding that Silverwood was the primary prevailing party entitled to costs the trial court noted that although the Kellys prevailed as to their prayer for an accounting and winding up of the partnership affairs, Silverwood prevailed in terms of the court's finding that the Kellys had no equity in the partnership at dissolution or thereafter and no right to a claim for rent or other compensation for Silverwood's post-dissolution use of partnership assets. The trial court did not abuse its discretion in weighing the relative value of the relief each party obtained.

V.

THE TRIAL COURT DID NOT ERR IN DENYING SILVERWOOD'S REQUEST FOR ATTORNEY FEES PURSUANT TO I.C. § 12-120(3) AND I.C. § 12-121

A. I.C. § 12-121[5]
An award of attorney fees pursuant to I.C. § 12-121 is only proper when an action was either brought or defended frivolously, unreasonably, or without foundation. Hossner v. Idaho Forest Indus., Inc., 122 Idaho 413, 416, 835 P.2d 648, 651 (1992). Where a party's claim, though unsuccessful, is offered in good faith with no intent to delay or hinder justice, the district court does not abuse its discretion in denying attorney *1328 fees. Cunningham v. Bundy, 100 Idaho 456, 459, 600 P.2d 132, 135 (1979).
The trial court concluded that the Kellys did not pursue their claim frivolously and without foundation. The specific issues presented by this case had not been addressed by this Court previously. The district court did not abuse its discretion in denying Silverwood's claim for attorney fees under I.C. § 12-121.

B. I.C. § 12-120[6]
This Court exercises free review over questions of law. Automobile Club Ins. Co. v. Jackson, 124 Idaho 874, 876, 865 P.2d 965, 967 (1993).
An award of attorney fees is not warranted every time a commercial transaction is remotely connected with a case. Rather, the test is whether the commercial transaction comprises the gravamen of the lawsuit. Attorney fees are not appropriate under I.C. § 12-120(3) unless the commercial transaction is integral to the claim and constitutes the basis upon which the party is attempting to recover. Spence v. Howell, 126 Idaho 763, 776, 890 P.2d 714, 727 (1995).
In denying Silverwood attorney fees, the district court reasoned that the issue before it was whether an accounting, a winding up of the partnership affairs, and a distribution of partnership assets constitutes a "commercial transaction." As this Court stated in Brower [v. E.I. DuPont De Nemours and Co., 117 Idaho 780, 792 P.2d 345 (1990)], and reiterated in Howell, the issue is whether a commercial transaction constitutes the basis upon which the party is attempting to recover. Thus, the issue here is whether a commercial transaction constitutes the basis for the Kellys' claim for an accounting and a winding up, and Silverwood's counterclaim.
The case of Gumprecht v. Doyle, ___ Idaho ___, ___ P.2d ___, 1995 WL 464936 (1995) issued recently by this Court ruled that an action to enforce a statutory penalty was not a commercial transaction. That authority is applicable and controlling. The gravamen of this case was an effort to enforce a statutory scheme of dissolution. The decision of the district court is affirmed.

VI.

CONCLUSION
The decisions of the district court are affirmed. Costs are awarded the respondent on appeal. No attorney fees are allowed.
McDEVITT, C.J., and JOHNSON, TROUT and SILAK, JJ., concur.
NOTES
[1]  53-331. Causes of dissolution.Dissolution is caused:

1. Without violation of the agreement between the partners.
....
b. By express will of any partner when no definite term or particular undertaking is specified.
[2]  53-332. Dissolution by decree of court.1. On application by or for a partner the court shall decree a dissolution whenever:

....
f. Other circumstances render a dissolution equitable.
[3]  53-322. Right to an account.Any partner shall have the right to a formal account as to partnership affairs:

....
4. Whenever the circumstances render it just and reasonable.
[4]  53-337. Right to wind up.Unless otherwise agreed the partners who have not wrongfully dissolved partnership or the legal representative of the last surviving partner, not bankrupt, has a right to wind up the partnership affairs: provided, however, that any partner, his legal representative or his assignee, upon cause shown, may obtain winding up by the court.
[5]  12-121. Attorney's fees.In any civil action, the judge may award reasonable attorney's fees to the prevailing party or parties, provided that this section shall not alter, repeal or amend any statute which otherwise provides for the award of attorney's fees ...
[6]  12-120. Attorney fees in civil actions.

.....
(3) In any civil action to recover on an open account, account stated, note, bill, negotiable instrument, guaranty, or contract relating to the purchase or sale of goods, wares, merchandise, or services and in any commercial transaction unless otherwise provided by law, the prevailing party shall be allowed a reasonable attorney fee to be set by the court, to be taxed and collected as costs.
The term "commercial transaction" is defined to mean all transactions except transactions for personal or household purposes....
