
499 P.2d 279 (1972)
28 Utah 2d 134
Merlin JACKSON, Plaintiff and Respondent,
v.
Lothaire R. RICH, Defendant and Appellant.
No. 12602.
Supreme Court of Utah.
June 27, 1972.
*280 Lothaire R. Rich, Salt Lake City, for appellant.
Eldon A. Eliason, Delta, for respondent.
ELLETT, Justice:
The defendant owned a building and rented part of it to the plaintiff, for a price of $140 per month, one half of which was to be paid in cash and one half credited for repairs to the building which plaintiff was to make. The parties agreed that Mr. Jackson was to be allowed credit on the rent at the rate of $3.50 per hour for work done and wholesale cost plus 10 per cent for material purchased and used in connection with the repairs being made.
The plaintiff brought this action for work performed and material furnished. Trial was to a jury, which rendered a verdict in favor of the plaintiff for the sum of $1229, less rent owed to defendant of $490, for a net amount of $739.
The evidence clearly shows that the plaintiff never paid any cash to the defendant for rent and that on May 16, 1969, the defendant evicted the plaintiff from the building. The record does not show whether the eviction was made pursuant to a court order or otherwise. Res judicata is an affirmative defense which must be pleaded,[1] and since it is not raised in this case, it does not matter how the eviction was consummated.
The trial court instructed the jury as follows:
Therefore, in this lawsuit, even though you find the Plaintiff had failed to pay the rent each month as required, if you should further find that the Plaintiff provided labor and materials in remodeling and renovating Defendant's business in an amount equal to or in excess of the rental required, then, you may find that the Plaintiff was not in default and would be entitled to require the performance of the Defendant under the terms of the agreement. In the event you should so determine the facts from the evidence, then you may find that the Plaintiff is entitled to damages from the Defendant in the amount of labor and materials furnished, less an offset in the amount of the rental due, if any, for the period that the Plaintiff had the use and possession of Defendant's building.
By this instruction the court made a new contract for the parties. The agreement was that Mr. Jackson would pay $70 per month cash and would be allowed an additional $70 per month in labor and material, provided the same was furnished. Mr. Rich never promised to pay cash for the repairs to be made to the building. He merely agreed to permit Mr. Jackson to have credit for one half of the rent for labor performed and material furnished in making those repairs.
By failing to pay $70 per month in cash, Mr. Jackson first breached the contract, and he cannot now complain because Mr. Rich evicted him. If he had any reasonable grounds to think that he did not owe any rent to Mr. Rich, he should have resisted eviction and used up the value of his labor and material in continuing in possession under his rental agreement.
The law regarding the rights under a contract of one who first breaches it is set out in 17 Am.Jur.2d, Contracts § 365, as follows:
As a rule, a party first guilty of a substantial or material breach of contract cannot complain if the other party thereafter refuses to perform. He can neither insist on performance by the other party nor maintain an action against the other party for a subsequent failure to perform. At least, the party first committing a substantial breach of a contract cannot maintain an action against the other contracting party for a subsequent failure to perform if the promises are dependent. It has also been said that where a contract *281 is not performed, the party who is guilty of the first breach is generally the one upon whom rests all the liability for the nonperformance... .
It may be that Mr. Rich has been unjustly enriched by the repairs made, depending on whether the repairs were made solely for the business to be conducted by Mr. Jackson or whether they actually enhanced the value of the building or the rental value thereof. It also may be that some form of relief other than an action on the contract is available to Mr. Jackson. However, if he first breached the contract by failing to pay the cash rental to Mr. Rich, he cannot recover a money judgment under the terms of that contract which only provided for payment in rent.
The dissent assumes that the issue of unjust enrichment was tried by consent of the parties. Such was not the case. The defendant objected to the trial of the matter at all, contending vigorously that plaintiff could not sue upon a contract which he had first breached. It should also be noted that there was no evidence of the value to Mr. Rich of the work done. The only evidence given to the court was as to the value of material furnished and the amount of labor performed.
There was no evidence of any modification of the contract, nor did plaintiff claim there was any such modification. He himself testified as follows:
I was to receive three dollars and fifty cents an hour for the labor and wholesale plus 10 per cent on the materials. Half of the materials that went into this building rental unit, materials and labor that went into it was to be allowed on the rent at $70 a month, which was half of the rent. The other half I was to pay him in cash.
As to any work done in a part of the building not rented by plaintiff, he claimed that he was to be paid for it in cash. However, he admitted that the total amount of such repairs was only $179.16, which was less than one half of the rent due under his contract. When questioned on cross-examination about the agreement, he testified as follows:
Q On the work that was done on the motel and the work that you said you did on the Bradshaw Auto Parts, did you ever agree to accept that on credit for rent to be taken out later?
A No, not at that time.
Q Did you ever agree later to accept it as credit on the rent?
A I believe I was forced into having to accept it. I was never paid for it.
The judgment is reversed and the case remanded for such further proceedings in harmony with this opinion as may be meet and proper in order to do justice between the parties. Costs are awarded to the appellant.
CALLISTER, C.J., and TUCKETT, J., concur.
HENRIOD, J., concurs in the result.
CROCKETT, Justice (dissenting):
It appears to me: that the issues in dispute between these parties were fully tried and determined in accordance with the spirit and intent of our Rules of Civil Procedure; that a jury, under careful and proper instructions from the court, has made findings and determination thereon; that they have been given approval by the trial court; consequently it is my opinion that the judgment should not be overturned.
Rule 15(b) provides that:
When issues not raised by the pleadings are tried by express or implied consent of the parties, they shall be treated in all respects as if they had been raised in the pleadings. Such amendment ... as may be necessary to cause them to conform to the evidence... may be made ... at any time, ... but failure so to amend does not affect the result of the trial of these issues.
Rule 54(c) (1) provides:
... every final judgment shall grant the relief to which the party in whose favor it is rendered is entitled, *282 even if the party has not demanded such relief in his pleadings. ... and it may, when the justice of the case requires it, determine the ultimate rights of the parties on each side as between or among themselves.
The agreement between these parties was based on their oral conversations and letters referring to them. As to definiteness they leave a great deal to be desired. Accepting the premise that as to the portion of defendant's commercial property rented to the plaintiff the $140 per month was to be paid $70 in cash and the other $70 in labor and materials, there is no reason I know of why the parties could not modify such an agreement. As will be seen below, this was the view taken by the trial court and the basis upon which the issues were submitted to the jury.
There is ample basis in the evidence to support the plaintiff's contention that the defendant requested the plaintiff to work on other parts of the defendant's commercial property complex and promised to pay him at the same rates, that is, $3.50 per hour for labor and cost plus 10 per cent for materials, and that the plaintiff did so in compliance with that request.
It is the plaintiff's contention that he furnished such labor and materials of a total value of $1802.28, and deducting $310.92 as an offset for rent he owed, there remained owing $1491.46. Defendant answered by a denial, and asserted as a defense that the plaintiff was not qualified and licensed to do plumbing or carpentry work; and also counterclaimed for $1500 for alleged damages caused to the premises by the plaintiff.
The issues just stated were submitted to the jury for determination under instructions which I think were fair, adequate and appropriate as shown by the following pertinent parts:
... the parties to an agreement may, by mutual consent, amend, modify or change the terms of the agreement. Such amendment, modification or change of the terms of an existing agreement may be accomplished by the parties orally; by a subsequent written instrument or even by a course of dealing. The burden to prove any such amendment, modification or change, however, is placed upon the party [the plaintiff] claiming such fact and this must be established to your satisfaction by a preponderance of the evidence.
* * * * * *
... the Plaintiff has the burden of proving by a preponderance of the evidence as heretofore defined for you that the Plaintiff, pursuant to the agreement between the parties, provided labor and materials in renovating and remodeling Defendant's building. On the other hand, the Defendant has the burden of proving by a preponderance of the evidence ... that the Plaintiff failed and refused to pay the rent . .. and/or further damaged the Defendant's building during the period of time the Plaintiff had possession of said premises.
* * * * * *
... the plaintiff is attempting to recover under one theory of the law for the amount of the benefit which the defendant has received due to the improvements made by the plaintiff on the property of the defendant. In considering this theory, the plaintiff cannot recover for all of the time and money put in by him, but only for the actual worth of the work and materials to defendant, ... . In determining the value of the benefit, you are permitted to consider as an offset any sum which it has cost the defendant to improve on the work done to meet the standard agreed upon by the parties, either expressly or implied, in the event you find the work performed by the Plaintiff did not meet such agreed upon standard.
* * * * * *
If you find from a preponderance of the evidence that there was an express or an implied agreement between the Plaintiff and the Defendant whereby the Plaintiff was induced to perform work *283 for the defendant in return for a payment or credit, and if you further find that the Plaintiff in reliance upon such express or implied agreement actually performed work and services and/or furnished materials for the Defendant's building, then the Plaintiff is entitled to recover the agreed price therefor, or in the event there was no agreement as to price, the Plaintiff is entitled to recover the reasonable value of such work and materials.


On the basis of those instructions the jury
found in favor of the plaintiff and against
the defendant in the amount of _______________ $1229.00
and allowed as an offset unpaid rental _______ 490.00
leaving a net judgment of ____________________ 739.00
This was a unanimous verdict, signed by all eight jurors.

In a number of cases I have expressed my views as to the importance of respecting the right of trial by jury. In order to avoid repetition here I refer to them as expressed in my dissents in the cases of Roylance v. Davies, 18 Utah 2d 395, 424 P.2d 142; DeMille v. Erickson, 23 Utah 2d 278, 462 P.2d 159; and the authorities therein cited. On the basis of those principles I would sustain the jury verdict and the judgment of the trial court. (All emphasis mine.)
NOTES
[1]  Rule 8(c), U.R.C.P.
