The opinion of the court was delivered by
Abbott, J.:At issue in this appeal is whether the trial court erred in dividing the sale proceeds of real estate sold in a partition action by giving credit to Wylie G. Denton for the cost of improvements made to the partitioned property.
The parties, Wylie G. Denton and Gaiy M. Lazenby, intended to acquire the realty as tenants in common, repair a dam on the property, and then divide the property equally (66 acres each). They entered into a contract for deed to purchase the property for $70,500; the parties were to pay the seller in cash the difference between the purchase price and the balance due on the seller’s mortgage and they were to assume the seller’s mortgage. Denton paid $19,050 toward the purchase price. Lazenby paid *861$17,405 toward the purchase price. The contract for deed provided that when Lazenby sold his house he would pay the balance and that he had 18 months to do so.
Denton secured the labor and equipment of friends to aid in repairing the dam. The trial court determined the services and equipment procured to have a value of at least $39,000. It is a credit for this sum that is in dispute.
A falling out occurred between the parties. Lazenby subsequently paid off the contract for deed by making an additional payment of $41,586.17.
Denton then filed this lawsuit. Count I of the petition asked that the oral agreement between the parties be enforced; Count II asked for an accounting; and Count III asked that, in the alternative, the land be partitioned.
Lazenby answered, denying the allegations, and added a counterclaim for partition.
Prior to trial, the parties stipulated that the property could not be partitioned in kind and thus needed to be partitioned by sale.
The trial court made detailed and extensive findings of fact and ordered the real estate partitioned by sale. Denton’s interest in the real estate was set at $58,050 ($19,050 + $39,000). Lazenby’s interest was set at $58,991.67 ($17,405.50 + $41,586.17). Any amount from the sale above $117,041.67 would be shared equally.
Lazenby appealed to the Court of Appeals. The only issue appealed was whether the trial court erred in giving Denton credit for the cost of improvements to the land. The Court of Appeals panel held in an unpublished opinion filed November 24, 1993, that a cotenant can receive credit for improvements added to property, but the credit is not the cost of the improvement — it is the amount by which the value of the property is enhanced by those improvements at the time of sale. The Court of Appeals panel relied on Miller v. Miller, 222 Kan. 317, 564 P.2d 524 (1977), for its holding. The panel went on to hold that “[t]he amount of the enhancement to the property’s value may be more or less than the costs of the improvements to be determined by the trial court in the exercise of its power to make an equitable *862partition. Renensland v. Ellenberger, 1 Kan. App. 2d 659, 666, 574 P.2d 217 (1977).”
The Court of Appeals remanded for a determination of the amount “by which die property’s value at the time of sale was enhanced by Denton’s improvements.” If indeed the general rule advanced in Miller applies to the facts of this case and the correct time to measure the value is at “the time of sale,” interesting questions that are not before us would need to be answered. We were advised at oral argument that last summer’s excessive rainfall and floods have completely washed out the dam. The property has not been sold because Lazenby posted a supersedeas bond. Thus, an appraisal at this time or in the future would necessarily reflect that at the time of the sale the repairs to the dam (improvements) would add nothing to the value of the land.
A number of rules apply to partition actions where a cotenant has improved the property. The rule set forth in Miller, 222 Kan. 317, is the general rule. However, the general rule is usually applied to situations where there has been a title dispute and one party acting in good faith has made improvements or where a cotenant acting in good faith has, with or without the knowledge of the other owners, made improvements. Various remedies have been fashioned in an effort to do equity to all the cotenants.
Here, we have a factor not present in most partition actions which we believe calls for applying a different rule than set forth in Miller.-To apply Miller to all partition actions where partition in kind is not possible would result in harsh outcomes in cases such as the one presently before us, where cotenants agree on making improvements on the property and jointly do so but one cotenant shoulders an unequal burden.
The parties here agreed the dam would be repaired, and each party put in a considerable amount of time and effort doing so. They also agreed they would not obtain the required state permit before undertaking the repair, and if the dam was negligently repaired, each had an equal part in such repairs. The improvements were made jointly and with full knowledge and consent of the other cotenant. Denton undertook to make improvements to the property by repairing the dam. Lazenby undertook to pay *863more than his share of the mortgage. Both Denton and Lazenby appear entitled, in determining an equitable division of proceeds from the partition sale, to receive credit or reimbursement for their respective undertakings. We hold the trial court applied equity principles to the facts before it and did not err in doing so.
In a partition action, K.S.A. 60-1003(d) gives a trial court authority to make any order not inconsistent with Art. 10, ch. 60 of the Kansas Statutes Annotated which may be necessary to make a just and equitable partition and to secure the respective interests of the parties.
The trial court may make an order necessary to a just and equitable partition. Dawson v. Dawson, 136 Kan. 471, 477, 16 P.2d 946 (1932). Dawson did apply the Miller rule. However, in Phipps v. Phipps, 47 Kan. 328, 336, 27 Pac. 972 (1891), this court stated that each case makes its own laws. In McKelvey v. McKelvey, 83 Kan. 246, 249, 111 Pac. 180 (1910), this court held that lasting improvements made in good faith by a cotenant which enhanced the value of the land are subject to equitable recognition and compensation in making the partition.
"In partition proceedings, a co-tenant’s right to contribution for improvements and other expenses is not a legal right, but arises from principles of equity.” Janik v. Janik, 474 N.E.2d 1054, 1057 (Ind. App. 1985). A rationale for allowing compensation for the value of improvements is to prevent a nonimproving cotenant from being unjustly enriched by improvements to which he or she did not contribute. Capogreco v. Capogreco, 61 Ill. App. 3d 512, 514, 378 N.E.2d 279 (1978). One of the reasons for limiting the amount of reimbursement to the increase in value of the property is to prevent one cotenant from negating another cotenant’s interest in the property by making expensive improvements and then being reimbursed for the cost of improvements which the nonimproving cotenant did not desire or which do not comparably increase the value of the property. See Graham, v. Inlow, 302 Ark. 414, 790 S.W.2d 428 (1990); In re Marriage of Berger, 140 Ariz. 156, 680 P.2d 1217 (1983); Capogreco v. Capogreco, 61 Ill. App. 3d 512; Janik v. Janik, 474 N.E.2d 1054. In In re Marriage of Berger, 140 Ariz. at 164, the court noted that a rule giving an *864improving cotenant credit for the value of the improvement rather than its cost protects both the improving cotenant and the non-improving cotenant: The nonimproving cotenant is not burdened with the cost of improvident improvements, and the improving cotenant is protected when his or her improvements have greatly appreciated in value. Cf. Renensland v. Ellenberger, 1 Kan. App. 2d 659, 666, 574 P.2d 517 (1977) (“the value of improvements may be more or less than their cost”).
The above are the general rules and are sustained by the great weight of authority. However, cases arise in which it would be inequitable to permit these rules to govern. Dean et al. v. O’Meara et al., 47 Ill. 120 (1868); Ford et al. v. Knapp et al., 102 N.Y. 135, 6 N.E. 283 (1886); Moore v. Thorp, 16 R.I. 655, 19 A. 321 (1889); Johnson v. Pelot, 24 S.C. 255 (1885); Ward v. Ward’s Heirs, 40 W. Va. 611, 21 S.E. 746 (1895); 59A Am. Jur. 2d, Partition § 241, n.12, p. 144. For example, if a nonimproving cotenant has requested improvements or has actively participated in bringing about improvements, equity would not require limiting reimbursement to the improving cotenant to the amount by which the value of the property was increased. Ward v. Ward’s Heirs, 40 W. Va. at 622-23.
By statute, K.S.A. 60-1003, the trial court in a partition action is to make a just and equitable partition and secure the parties’ respective interests. This includes an accounting and adjusting of equities. See Scott et al. v. Guernsey et al., 48 N.Y. 106 (1871), Wright agt. Wright, 59 How. Pr. 176 (N.Y.S. Ct. 1879); Whitmire v. Powell, 103 Tex. 232, 235-36, 125 S.W. 889 (1910); Kalteyer, Executrix v. Wipff, 92 Tex. 673, 683, 52 S.W. 63 (1899).
Here, the trial judge could have accomplished the same result by using different labels, i.e., other rules of law. A majority of this court holds this case is an exception to the general rules of law concerning improvements placed on real property by a co-tenant. The trial court did not err in its holding. The decision of the Court of Appeals affirming in part, reversing in part, and remanding to the district court is affirmed in part and reversed in part. The decision of the district court is affirmed.
Holmes, C.J., concurs in the result.