This is an appeal from a judgment for damages entered pursuant to the verdict of a jury, against the defendant for breach of a building contract. The evidence, when viewed in the light most favorable to the plaintiff in whose favor the verdict was rendered, discloses these facts. In April 1930 the plaintiff and defendant entered into a contract for repairing and building an addition to a house and installing a furnace therein. The house was twenty by thirty feet, one and a half stories high. The interior of the first story was finished and the second story was unfinished. At the time the contract was entered into a Mr. Richards, representing the defendant, came out to *Page 524 
the plaintiff's place and discussed with him the particulars of the work to be undertaken. They discussed the probable cost, and went over each item. The items covered by the conversation are as follows: Raising the house so that the bottom of the cellar window sills would be level with the top of the ground; plastering on metal lath over the old plaster; plastic painting of the interior; remodeling the upstairs using sheet rock and material to cover the nails so that they would not show; building on a small room upstairs as a dormer; laying a new floor upstairs. When completed, the job was to have two rooms and a dormer upstairs, and installation of water pipes to the dormer.
A few days later another conversation was had and the basement was discussed. It was agreed that the defendant would put in a cement wall six inches thick in the basement beside the stone wall that was already there. The house was to be raised as had been mentioned in the previous conversation, a distance of about eighteen inches. It was then agreed that a furnace was to be installed in the basement, the house having been previously heated by stoves. It was to be a pipe furnace guaranteed to heat the house. The maple floors downstairs were to be resurfaced. The floors in the dining room and the living room were to be scraped. It was also agreed that a ten by twenty foot addition was to be built with sheet rock on the walls, and new floors. The sheet rock was to be covered so that the joints and nails would not show. The addition was to contain two rooms and a stairway going to the basement. It was also agreed that a stairway would be constructed from the main floor to the second story by taking out an old stairway and building a new one in its place. Also the old basement stairway was to be taken out and a clothes closet to be built in its place. Richards then calculated the approximate cost and advised the plaintiff that it would cost between $1100 and $1200 and not more than $1300. The work was commenced on April 7 and completed about May 13. The plaintiff continued to live in the house, but most of the time was busy working in his fields.
The plaintiff complains that the defendant cut two joists under the main floor in order to insert cold air registers for the furnace. No header was installed, resulting in the weakening of the floor over a space of about six feet. Another joist was cut in order to install a sewer pipe, and no support provided in its place. This occurred directly *Page 525 
under a partition with the result that the house is sagging and the walls are cracking, there being no support beneath the partition. Another joist was cut under the partition wall in the living room where a warm air register was installed. Another joist cracked under the stairway causing the stairway to sag. Joists were also cut around the chimney which was installed by the defendant. A two by four was used as a header on one side of the chimney and on the other no header was put in at all. A clothes-chute is beside the chimney. The clothes-chute is sagging down and the plaster is cracked. The floors downstairs are not level. Some of the floor boards upstairs do not meet on the joists and there is a large crack between the floor and wall along the side of one room.
When the defendant attempted to jack up one corner of the house the cellar wall gave way and collapsed into the basement. The corner of the house sagged. The defendant afterward raised it approximately to its original position, but did not raise the house eighteen inches as had been provided for in the agreement. It was agreed that the basement wall was to be waterproof. The cement is full of holes and soft in spots, and permits water to run into the basement. The chimney is cracked on three sides. The air ducts for the furnace were covered with a layer of asbestos. The boards shrunk, cracking the asbestos paper cover and resulting in the impairment of the air circulation of the furnace. The nails and joints of the sheet rock were not covered. The joints in the sheet rock in the ceiling were filled with plaster, but the plaster fell out. There are four different cracks in the plaster about the chimney. The floors were not scraped. Some of the plaster has fallen out around the sewer pipe, the joint of which was not concealed in the wall. Plaster on the ceiling has cracked. Some of the steps on the stairway are loose and squeak. The defects complained of are disputed or minimized by the evidence of the defendant.
The plaintiff paid the defendant $900 on May 21, 1930, and at that time complained of some of the defects. After this action was commenced the defendant brought a garnishment action against the plaintiff in the state of Iowa and recovered the balance which the defendant claimed to be due on the contract. It is now contended that the payment of $900 constitutes a waiver of the defects and that the recovery *Page 526 
by the plaintiff in the Iowa court renders the plaintiff's present cause of action res adjudicata.
An owner may acquiesce in the builder's failure to perform a contract and by accepting and paying for the work may waive his claim for damages on account of defects. The partial payment made by the plaintiff does not constitute a waiver because he protested and continued to protest concerning the defects and refused to pay the balance. Under the facts in this case the plaintiff cannot be held to have waived his claim for damages by accepting the work because of the fact that he was compelled to use the defective work. He was living in the house at the time the work was done and of necessity continued to occupy it after the defective work was completed. Marchand v. Perrin, 19 N.D. 794, 124 N.W. 1112; Williston, Contr. rev. ed. § 724; 9 Am. Jur. Building and Construction Contracts, § 53. In Zambakian v. Leson,77 Colo. 183, 234 P. 1065, the court discusses the acceptance of the work as a waiver of defective performance, and says: "However, the mere acceptance, without more, does not preclude the owner from recouping damages for defective performance, especially where he could not do otherwise than accept the situation in which the contractor had placed him. 9 C.J. 802, and cases in note in 23 A.L.R. 1435."
Defendant's contention that the matter in litigation is res adjudicata cannot be sustained. Res adjudicata was not pleaded as a defense. Neither the record nor the judgment entered in the Iowa court was presented in evidence in this action. It does not appear that the plaintiff interposed a counterclaim in the Iowa suit, or in any way presented to the court the question of damages arising from the alleged breach of contract. The judgment of the Iowa court operates as an estoppel only as to those matters or questions therein litigated and determined. 15 R.C.L. p. 972; 34 C.J. 863; Coyle v. Due, 28 N.D. 400, 149 N.W. 122.
The evidence shows that the contract covered the building of a complete new addition ten by twenty feet, the repairing and altering of the old house, and the installation of a hot air furnace in the completed building. It is more than a mere contract for repairs. It is a building contract and damage for a breach thereof is measured according to the law applicable to such contracts. The measure of the allowance to *Page 527 
the plaintiff must necessarily be a sum that will compensate him for the injury resulting from the omissions and variations due to the fault of the defendant. The measure of damages to be applied is that one which will be most likely to produce a fair and just result. M.J. Daly  Sons v. New Haven Hotel Co. 91 Conn. 280,99 A. 853.
The appellant vigorously contends that the wrong measure of damages was applied and specifically challenges the instructions of the court with reference thereto. The court first instructed the jury that before they could find for the plaintiff it would be necessary to find that there was a lack of substantial performance of the contract on the part of the defendant. He then instructed on the measure of damages as follows:
"Now the measure of damages in this case, members of the jury, is the difference between the value of the house as finished by the defendant and what the value of the house would have been if it had been finished according to contract."
At common law, strict and literal compliance with a contract was a condition precedent to recovery thereunder. The courts now generally hold that substantial compliance and not literal compliance is sufficient to enable the builder to recover on his contract, but substantial compliance does not absolve the builder from responding in damages for his omissions and derelictions. 9 Am. Jur. Building and Construction Contracts, § 43; Hammaker v. Schleigh, 157 Md. 652, 147 A. 790, 65 A.L.R. 1285. It entitles him to recover on the contract the amount thereof less damages to the owner for a breach. If he fails to substantially perform he may not recover at all under the contract. Anderson v. Todd,8 N.D. 158, 77 N.W. 599; Braseth v. State Bank, 12 N.D. 486, 98 N.W. 79.
This is a suit by the owner for damages for failure on the part of the builder to comply with the contract. The builder has already been paid and, therefore, seeks no further recovery from the owner. We are not interested in whether the builder may have maintained a suit upon the contract. Substantial performance is not an issue. The questions in this case are, was there a breach of contract on the part of the builder that resulted in damage to the owner and if so by what rule or rules shall the damage to the owner be measured.
In Williston on Contracts, rev. ed. § 1363 it is said: "Where the *Page 528 
contractor fails to keep his agreement, the measure of the employer's damages, whether sought in an independent action or by recoupment or counterclaim, is always the sum which will put him in as good a position as if the contract had been performed If the defect is remediable from a practical standpoint, recovery generally will be based on the market price of completing or correcting the performance, and this will generally be shown by the cost of getting work done or completed by another person. If the defect is not thus remediable, damages are based on the difference between the value of the defective structure and that of the structure if properly completed."
The Supreme Court of Nebraska, in Graham v. Anderson,121 Neb. 733, 238 N.W. 362, discusses the rules applicable to the measure of damages to be applied for breach of building contracts as follows:
"Under the building contract plaintiff constructed a dwelling-house, but the evidence shows conclusively that, in some essential particulars relating to materials and workmanship, he did not comply with specifications. Defendant did not accept the building with its defects or waive full performance on the part of the contractor. In this situation the measure of plaintiff's recovery is the agreed price, less the damages resulting from the failure to fully comply with the contract. See annotations and cases cited in 23 A.L.R. 1435. What measure of damages for defects should be adopted is the controlling question presented by the appeal. There is a generally accepted rule applicable to building contracts that, where defects in materials, construction or workmanship are remediable without materially injuring or reconstructing any substantial portion of the building, the damage which the owner is entitled to recover is the expense of making the work conform to contractual requirements. See 23 A.L.R. 1436; 65 A.L.R. 1298. This rule has been recognized in Library Bd. v. Ohlsen, 110 Neb. 146, 193 N.W. 110. The principle stated is now invoked by plaintiff, who argues that he substantially performed his contract; that the evidence fails to prove that the necessary expense of remedying defects exceeded $185; that consequently the damages allowed by the district court are excessive and erroneous.
"There is, however, another generally accepted rule to the effect that, where a contractor's violations of a building contract result in defects which cannot be remedied without reconstruction of, or material *Page 529 
injury to, a substantial portion of the building, the measure of the owner's damages is the difference between its value when constructed and what its value would have been if built according to contract. Cases so holding are collected in 23 A.L.R. 1438. This is in harmony with the view expressed in Lincoln Stone 
Supply Co. v. Ludwig, 94 Neb. 722, 144 N.W. 782. There is no conflict between the two lines of decisions. Each rule is enforceable under any state of facts to which it applies."
Thus it appears that where defects resulting in a breach of a building contract may be remedied without taking down and reconstructing a substantial portion of the building the amount of damages to the owner occasioned by such breach is the expense of making the work conform to the contract. White v. Mitchell,123 Wash. 630, 213 P. 10; Turner v. Jackson, 139 Or. 539,11 P.2d 1048; Hoskins v. Williamson, 228 Ky. 395, 15 S.W.2d 242. But where the defects are such that they cannot be remedied without a reconstruction of a substantial portion of the work the measure of damages is that expressed by the trial court in the instruction to the jury quoted above. Walsh v. Cornwell,272 Mass. 555, 172 N.E. 855; Taulbee v. Moore, 106 Ky. 749, 51 S.W. 564; Pelatowski v. Black, 213 Mass. 428, 100 N.E. 831; Gutov v. Clark, 190 Mich. 381, 157 N.W. 49; Otis Elevator Co. v. Flanders Realty Co. 244 Pa. 186, 90 A. 624.
In this case the trial court should have required the jury to determine whether the defects were remediable and then have instructed them upon the two measures of damages above set forth, thus enabling the jury to apply one measure in event the defects were found to be remediable and the other if they were not.
The appellant effectively contends that it was prejudiced by the erroneous admission of evidence of values. The following will serve as an illustration. The witness Jencks, who was a carpenter, examined the house on the 9th of June 1936, which was six years after the completion of the work. He described many defects, most of which it had been previously shown had become apparent in some form shortly after the work was completed. These questions and answers were then permitted by the court over the defendant's timely objections.
"Q. Mr. Jencks, in what condition do you consider that house to be in at the present time? *Page 530 
"A. Why I don't consider it fit to live in.
.     .     .     .     .     .     .     .     .     .     .
"Q. Mr. Jencks, what do you consider to be the difference in value between the house as it stands with such defects in it and its value if the house were in good condition and the defects did not exist?
"A. $250 or $300, that is the difference between the value of the house now and what it would be if it was fixed up as it stands now.
"Q. Now, Mr. Jencks, how much more in your estimation would this house be worth if it did not have these defects about which you have testified?
"A. Well, the house would be worth $600 or $700 more if it was put up on a foundation and repaired than it is at the present time."
A motion to strike the last answer was denied.
The major vice of this testimony is that it ignores both the lapse of time and the terms of the contract. The question for the jury to determine, in event that the defects were not remediable, was the difference in the value of the house as constructed and as contracted for, at the time of the completion of the work (the plaintiff being in possession) and not values based on the condition of the building six years later. It was error to admit testimony as to values based on the condition of the building at the time of the trial. Likewise it was error to permit another witness to testify to the reasonable cost of repairing certain specific defects as of the time of the trial and without reference to the cost of such repairs at the time the work was completed or when the defects, if latent, became apparent.
Because of misinstructions and errors in the admission of evidence a new trial must be had.
Reversed.
CHRISTIANSON, Ch. J., and BURR and NUESSLE, JJ., concur.
SATHRE, J., did not participate. *Page 531