Plaintiff, as surviving partner of the firm of Lord & Plorton, seeks in this action to recover upon the quantum meruit for labor and material furnished to defendant at his request in the erection of a building in the city of Minot, known as the Arcade Building. A jury was expressly waived in the district court, and at the conclusion of the trial findings of fact and conclusions of law favorable to the plaintiff were made, and pursuant thereto plaintiff had judgment for the sum of $1,792.92 and interest, together with the costs. Thereafter defendant moved for a new trial, which motion was denied, and the case is here on appeal, both from the judgment and from such order.
Before noticing the specifications of error, a brief statement of the important facts will be made. On June 3, 1907, Lord & Horton, contractors and builders of Minot, entered into a written contract with the defendant, a resident of said city, whereby such contractors undertook *263and agreed for and in consideration of the sum of $16,000 to erect for the defendant in such city, a two-story and basement brick structure according to certain plans and specifications therein referred to. Such contract price was to be paid as follows: $3,000 upon the completion of the foundation for such building, $6,000 when the brick work was completed and the roof on and the window openings closed up, and the final payment of $7,000 within thirty days after the completion of the building and when certificates for the same are issued.
That between June 15, 1907, and January 15, 1908, the said firm of Lord & Horton furnished the necessary labor and material for such building, and caused the same to be erected under the contract aforesaid, and shortly after the completion of such building the defendant went into possession thereof and occupied the same continuously until the trial. That he has made payments on such contract aggregating $13,600.
In March 1908, Lord & Horton commenced an action in the district court of Ward county against the defendant for the purpose of foreclosing a mechanic’s lien which they had theretofore filed against said building for the balance alleged to be due them under such written contract. Defendant answered the complaint in such action, and among other things alleged: “Defendant further alleges that heretofore, to wit, and on or about the 4th day of February, 1908, this defendant tendered in lawful money of the United States, to the said Lord & Horton, the sum of seventeen hundred ninety-two and ninety-two hundredth dollars ($1,792.92), that being the whole sum due and payable under the terms and conditions of said contract, after deducting the items of damage hereinbefore specified, and alloiuing for all just claims due to said plaintiffs, which said tender was by said plaintiffs refused, and thereupon this defendant did, on said 4th day of February, 1908, deposit in the Second National Bank of Minot the said sum last above mentioned to the order of said Lord & Horton; that said sum is at the date hereof on deposit in said bank, to the order of said plaintiffs, and is sufficient in amount to completely pay said plaintiffs all sums due and owing to said plaintiffs.” Also, “that the said sum so specified still remains on deposit in said bank, and this defendant now offers to produce the same in court, in full payment of all claims of said plaintiffs.” That as thus alleged defendant in fact made such tender and deposit, *264but prior to tbe trial of said action withdrew the same and amended his answer accordingly. On February 4, 1908, defendant caused to be served upon Lord & Horton a written notice as follows: “You will please take notice that I have this day deposited to your credit in the Second National Bank of Minot, North Dakota, the sum of $1,792.92, and directed said bank to pay the said amount to you upon receipt from you in full for all accounts by me owing to you this day.”
Such foreclosure action came on for trial before the late Judge Charles F. Templeton of the first judicial district, and at the conclusion of the trial findings of fact and conclusions of law favorable to the defendant were made and judgment entered dismissing the action. The gist of these findings of fact is to the effect that Lord & Horton, the plaintiffs, failed to comply with the contract in numerous particulars detailed in such findings, clearly showing a failure to substantially perform the contract. It is a very significant fact which must not be overlooked that this distinguished jurist, who possessed a keen legal mind and a high sense of equity and justice, not only did not find as a fact that plaintiffs wilfully or intentionally departed from the terms of the contract, but he expressly refused to so find. We have examined his original findings of fact and conclusions of law, which disclose that he refused' to make the following finding: “The court further finds as conclusions of fact that the plaintiffs did not intend to comply with the contract and did intend in some particulars at least to deceive the defendant, Emerson, with reference to what was being furnished, and did endeavor to deliver second and third class work and material in place of first-class; that the plaintiff took no care, and, in places at least, did not intend to follow the plans and specifications with reference to the matters of construction resulting in a very inferior combination, greatly damaging the building; that the building is damaged by virtue of failure to comply with the plans and specifications in the sum of not less than $3,431.10, thus offsetting the whole amount claimed to be due by the plaintiffs.” The refusal to make such requested findings, as well as the refusal of various conclusions of law requested, unmistakably disclose that it was the intention .of Judge Templeton to hold merely that no recovery could be had by plaintiffs on the contract, and he studiously avoided making any finding or conclusion which would in the least hamper or interfere with plaintiffs’ right to recover upon the *265quantum meruit. His letter addressed to plaintiffs’ counsel and which was introduced in evidence in the case at bar, fully corroborates us in the foregoing statement. The letter is as follows:
Grand Forks, N. D., Oct. 26-, 1908.
L. W. Gammons,
Minot, N. D.
Dear Sir:—
I have yours of the 24th regarding the case of Lord & Horton v. Emerson. My view of the case is that the present action should be dismissed upon the merits. The action is brought upon the contract to foreclose a lien. An action of this nature under the terms cannot be maintained, because there was not a substantial compliance with the contract, and the architect’s certificate was not fraudulently or arbitrarily withheld. That this action cannot be maintained under these circumstances, see Anderson v. Todd, 8 N. D. 158, 77 N. W. 599. As the lien cannot be upheld, plaintiffs cannot in this action recover a money judgment. Bray v. Booker, 6 N. D. 526, 531, 72 N. W. 933. I should not find all of the defendants proposed findings in any event. If you wish to submit a transcript of the testimony and argue the matter before I sign any findings, I will give you a reasonable time to do so.
Let me know your desire in the matter by early mail, as I am anxious to dispose of it.
'Tours truly,
Charles F. Templeton.
At the trial of the present action but little testimony was introduced. The only evidence offered as to the reasonable value of the -work and materials that went into the construction of such building was by stipulation that if one of plaintiff’s witnesses, w'ho was absent, were present and sworn he would testify that such reasonable value was $16,355.15. Proof w'as then offered to show' that the plaintiff, Horton, is the surviving partner of the'firm of Lord & Horton. Defendant was then called -for cross-examination, and testified’ to the fact that he took possession of the building shortly after its completion and has been in possession ever since; also that he paid to Lord & Horton on the con*266tract the sum of $13,600; also that he tendered to Lord Horton prior to the commencement of the foreclosure action, the said sum of $1,792.-'92, and deposited the same to their credit in the Second National Bank, and served written notice of such deposit. He also testified that in his prior answer in the foreclosure suit he alleged the making of such tender and deposit as above stated, and also that he subsequently withdrew such deposit. The portion of his answer in such foreclosure suit relative to the tender and deposit and notice thereof as aforesaid was offered in evidence by plaintiff’s counsel.
Among other things, defendant testified relative to his entering into possession of the building as follows:
Q. You did, however, in the fall of 1908, a short time after Lord & Horton had quit work on the building, go into the building and commenced to use it ?
A. Yes, sii’.
Q. You used all parts of the building ?
A. Yes, sir.
Q. And went into full control of the building, with full and complete control of the building, did you? Did you have full control of the building?
A. Expect I did.
Q. You expect you did; don’t you know ?
A. I accepted — but never got an order from the architect.
Q. Did you have to have an order from the architect to have control of the building?
A. Don’t know.
Q. You did have control ?
A. We went in.
Q. You know you had control of the building?
A. I suppose so.
Q. You don’t suppose, you know?
A. I did then.
Plaintiff then offered in evidence the letter from Judge Templeton heretofore quoted, after laying a foundation therefor, whereupon plaintiff rested.
*267Defendant then identified the exhibit “A” being the contract for the construction of said building, and offered the same in evidence, and proved by plaintiff, who was called for cross-examination, that he is seeking in this action to recover for the identical work and materials covered by such contract.
Defendant then offered in evidence the record of the judgment in the prior action, together with the judgment roll, consisting, among other things, of the pleadings, of findings of fact and conclusions of law, and the exhibits attached thereto, all of which were objected to by plaintiff’s counsel. The foregoing is in substance all of the testimony offered in the case at bar.
x\ppellant sets forth 12 so-called specifications of error, but they are treated under five points or subdivisions of their brief, which points we will notice only in a general way. Under point 1 counsel seem to contend that it was error to permit plaintiff in this action to prove the reasonable value of the material and labor which went into such structure. They call attention to the general rule that where parties have made an express agreement the recovery must be had on such contract, or not at all. It is, no doubt, true, as they contend, that as a general rule no implied contract can be found to exist in the face ■of an express contract entered into by the parties, but this general rule has an exception which is universally recognized by the courts. We shall not attempt to cite more than a few of the authorities recognizing such exception. Anderson v. Todd, 8 N. D. 158, 77 N. W. 599; Marchand v. Perrin, 19 N. D. 794, 124 N. W. 1112; Sheldon v. Leahy, 111 Mich. 29, 69 N. W. 76; Columbus Safe Deposit Co. v. Burke, 32 C. C. A. 67, 60 U. S. App. 253, 88 Fed. 630; Scholz v. Schneck, 174 Ind. 186, 91 N. E. 730; Merritt v. Layton, 1 Boyce (Del.) 212, 75 Atl. 795; Henderson v. Mace, 64 Mo. App. 393; Geary v. Bangs, 138 Ill. 77, 27 N. E. 462; Manning v. School Dist. 124 Wis. 84, 102 N. W. 356; Sutherland, Damages, 3d ed. § 711; 30 Am, & Eng. Enc. Law, 1224-1227, and cases cited.
It is, no doubt, true that in order to recover on such implied contract it must appear that the contractor in good faith endeavored to comply with his contract, and also that his labor and material have added value to the owner’s property, resulting in a necessary benefit accruing to him. In a few states, notably Wisconsin and California *268(Manning v. School Dist. 124 Wis. 84, 102 N. W. 356; Zottman v. San Francisco, 20 Cal. 96, 81 Am. Dec. 96) a recovery cannot be had on the quantum meruit, even though the contractor has in good faith partly performed his contract resulting in some enrichment of the proprietor, without proof of acceptance other than such as may be inferred from the mere fact that the improvement is retained and used. Judge Marshall of the Wisconsin court, while following the earlier precedents in his state, admits that there are many respectable authorities in other jurisdictions to the contrary. In this jurisdiction the question is one of first impression, and we therefore feel free to adopt the rule which seems to be more equitable and in accord with the weight of modern authority. Such rule is stated in 3 Sutherland on Damages, 3d ed. § 111, as follows: “But there is generally a more liberal consideration of the equitable rights of the contractor where he has in good faith endeavored to comply with his contract, and his labor has added value to his employer’s property, and a benefit necessarily accrues to him. Independently of any election to accept, the honesty of the contractor’s efforts towards full performance, the beneficial character of the work, and the impossibility of the employer declining and rejecting it so that the contractor may make it useful to himself, have induced the courts to adopt the rule of awarding compensation to the contractor to the extent that the employer is thus benefited. As early as 1828 this rule was acted upon in Massachusetts, and it has been repeatedly approved in later cases there as well as elsewhere. It was thus stated as a question on which there were many conflicting opinions: ‘Whether when a party has entered into a special contract to perform work for another, and to furnish materials, and the work is done and the materials furnished, but not in the manner stipulated for in the contract, so that he cannot recover the price agreed by an action on that contract, yet, nevertheless, the work and materials are of some value and benefit to the other contracting party, he may recover on a quantum meruit for the work and labor done, and'on a quantum valebant for the materials. AVe think the weight of modern authority is in favor of the action, and that, upon the whole, it is conformable to justice that the party who has the possession and enjoyment of the materials and labor of another shall be held to pay for *269them, so as in all events he shall lose nothing by the breach of the contract/
“The sole ground upon which a contractor is entitled to anything under this rule is that if he were not paid something the defendant would profit at his expense, although his claim is without merit as far as rights under the contract are concerned. Hence the amount which may be recovered is the amount by which, were no payment made, the defendant would profit at the plaintiff’s expense; that is to say, the amount which represents the fair market value of the structure which, against the wishes of the defendant, has been put upon his land. This value the plaintiff must prove before he can recover. If the contract is a beneficial one to the landowner the contractor is not entitled to recover any margin of the benefit which the former secured by the making of the contract; but the contractor is entitled to the value of the building as it is in the light of the landowner’s right to have the building built, and properly built, for the contract price. If, for example, the landowner secured by his contract the erection for $2,000 of a building worth $3,000, and the plaintiff, in erecting the building, fails to comply with the contract in matters going to the essence of the contract, and the building, erected as it is erected, is worth $2,500, the plaintiff is not entitled to recover $2,500; all that he is entitled to recover is 2%o of $2,000. The additional value of the land to the owner by reason of the labor and materials performed and furnished may, at least in many cases, be ascertained by deducting from the contract price what the house was worth less to the defendant by reason of the deviations from the contract.
“The doctrine is firmly established in Vermont that where a contract has been substantially, though not strictly, performed; where the party failing to perform according to its terms has not been guilty of a voluntary abandonment or wilful departure therefrom, has acted in good faith, intending to perform according to the stipulations, and has failed in a strict compliance with its provisions; and when, from the nature of the contract and of the labor performed, the parties cannot rescind, and stand in stain quo, but one of them must derive some benefit from the labor or money of the other, in such cases the party failing to perform strictly may recover of the other as upon a quantum meruit for such sum only as the contract, as performed, has been of real and *270actual benefit to tbe other party, estimating such benefit by reference to the contract price of the whole work. • The rule is treated as a relaxation from the strictness of the ancient law, standing upon the solid ground of necessity and equity, but to be guarded with care, lest in its. application it should tend to impair the obligation and faithful performance of agreements. The contractor must have intended in good faith to fulfil the terms of the contract; its spirit must be faithfully observed, though the very letter of it fail. A voluntary abandonment or a wilful departure from its stipulations is not allowed. The principle applies only in cases where the contract cannot be rescinded, and where, from its nature, the labor performed under it must inure to the benefit of the employer, and it would be inequitable for him to retain it. without making compensation. The party failing to perform can only recover such a sum as his labor has benefited the other. Had he strictly and literally kept his agreement, he would have been entitled to the-contract price. Failing in this: 1st. He must deduct from the contract price such sum as will enable the other party to get the contract completed according to its terms; or, where that is impossible or unreasonable, such sum as will fully compensate him for the imperfection in the work, and the insufficiency of the materials, so that he shall in this respect be made as good pecuniarily as if the contract had been, strictly performed; 2d. He must also deduct from the contract price - ■whatever additional damages his breach may have occasioned to the other.
“The substantial performance which is mentioned as requisite to-bring a case within this equitable principle is not that near approach to perfect and complete fulfilment of the contract which is necessary to entitle the contractor to recover on it. In one case the contractor was. reported to deserve about half price and was allowed to recover. In another, he agreed to build a stone wall 4-|- feet high, and more than half of it was less; but it was held that the contract was substantially - performed for the purpose of that remedy. . . .
“The principle enunciated in these cases has been applied in Connecticut. It is there held by a majority of the court that, if the result, of a builder’s labor is a structure adapted to the purpose for which it was designed, and the employer is in the use and enjoyment of it, and it cannot be made to conform to the contract otherwise than by the ex— *271penditure of a sum which would deprive the contractor of all compensation for his labor, a deduction may be made from the contract price to the amount of the diminution in value of the building, and not the amount it would cost to make it conform to the contract. Principles more or less liberal have been declared in other' states in favor of defaulting contractors who have performed in part, and from whose work the employer in fact derived a benefit, and recoveries permitted on a quantum meruit for a beneficial performance which was ilot sufficient to support an action upon the contract, either on the ground of voluntary appropriation, or the benefit the employer must necessarily derive from the work as done.”
We have quoted at much length from this author because of the very clear statement of the rule which we adopt in this jurisdiction, as not only sound on principle, but having the support of the great weight of authority.
By applying this rule to the facts before us, we have no hesitation in overruling appellant’s contentions under all his points, provided the contractors are not, under the evidence, to be charged with bad faith in deviating from the plans and specifications. Even under the restricted ride adhered to in a few jurisdictions as to acceptance of the building by the owner, we think plaintiff should recover, for the testimony of the defendant himself shows that he not only paid $13,600’ on the contract, but that he accepted the building shortly after its completion and has retained the same ever since. True, he should not be held to have accepted the same as a full compliance with the contract (Anderson v. Todd, 8 N. D. 158, 77 N. W. 599), but in the light of these facts, together with the fact that admittedly he thereafter tendered to the contractors the further sum of $1,792.92 and conceded by his answer that this balance was due after deductions for damages occasioned by failure to fully comply with the contract, we think warrants the presumption that he voluntarily accepted the benefits flowing to him from such partial performance of the contract.
Where, we ask, is the proof of bad faith ? We have set out practically all the testimony, and there is not a scintilla of evidence in this record from which the court would be warranted in finding bad faith, unless such proof is furnished in the judgment roll in the prior action. It. is contended that the findings contained in such judgment roll furnish *272conclusive evidence of bad faith and an intentional and wilful departure from the terms of the contract; but such contention is devoid of merit for obvious reasons. First, as we have above observed, Judge Temple-ton expressly refused to so find. This is alone conclusive against appellant’s contention. Second, the sole, and in fact the only, competent purpose of introducing such judgment roll was to show a former adjudication, as pleaded in the answer, of the issues sought to be litigated in the case at bar. Manifestly, such proof falls far short of the mark. The first essential to proof of res judicata is wholly lacking. The issues in the two actions widely differ. Proof which would support one cause of action would not support the other. In the foreclosure suit, proof of a failure in any respect to substantially perform the contract would defeat a recovery, but not so in the case at bar. Bad faith or intentional departure from the contract in substantial particulars was not necessarily involved in the former litigation; nor does the answer in the case at bar, much less the proof, allege or show that any such issue was in fact litigated in the prior suit, or that it formed any basis whatever for the judgment therein rendered, but the contrary is true, as we have above observed. It necessarily and logically follows that in this action w'e cannot look to the judgment roll in the former case for evidence of bad faith or a wilful or intentional departure from the contract.
The doctrine as to when and upon what conditions a former judgment may be successfully urged as res judicata in a subsequent action is too well settled to require extended discussion. In the early history of this court the rule was correctly announced and applied in Fahey v. Esterley Mach. Co. 3 N. D. 220, 44 Am. St. Rep. 554, 55 N. W. 580. We quote from the opinion of Mr. Justice Corliss: “The case we have to decide falls within that class of cases where a judgment on one cause of action is sought to be used as conclusive in a suit on another cause of action. In such cases the judgment is final only as to the matters which were in fact determined in the former case and adjudicated by the judgment. Foye v. Patch, 132 Mass. 105, and cases cited; Stone v. St. Louis Stamping Co., 155 Mass. 267, 29 N. E. 623; Cromwell v. Sac County, 94 U. S. 351, 24 L. ed. 195; Nesbit v. Independent Dist. 144 U. S. 610, 36 L. ed. 562, 12 Sup. Ct. Rep. 746; Bell v. Merrifield, 109 N. Y. 202, 4 Am. St. Rep. 436, 16 N. E. 55. The least uncertain*273ty as to what was in fact determined in the suit before the justice of the peace is fatal to the use of the judgment as an estoppel on the question of breach of warranty and rescission. The uncertainty created by the record of the proceedings before the justice is not in any manner cleared up by allegations in the answer that the question was in fact determined by the justice against the defendant therein, the plaintiff in the case at bar. ‘According to Coke, an estoppel must be certain to every intent; and if upon the face of a record anything is left to conjecture as to what was necessarily involved and decided, there is no estoppel in it when pleaded, and nothing conclusive in it when offered as evidence. It is undoubtedly settled law that a judgment of a court of competent jurisdiction, upon a question directly involved in one suit, is conclusive as to that question in another suit between the same parties. But to this operation of the judgment it must appear, either upon the face of the record, or be shown by extrinsic evidence, that the precise question was raised and determined in the former suit. If there be any uncertainty upon this head on this record, — as, for example, if it appear that several distinct matters may have been litigated, upon one or more of which the judgment may have passed without indicating which of them was thus litigated, and upon which the judgment was rendered, — the whole subject-matter of the action will be at large, and open to a new contention, unless this uncertainty be removed by extrinsic evidence showing the precise point involved and determined.’ Russell v. Place, 94 U. S. 606, 24 L. ed. 214. To same effect are Bell v. Merrifield, 109 N. Y. 202, 4 Am. St. Rep. 436, 16 N. E. 55; Stowell v. Chamberlain, 60 N. Y. 272; Stone v. St. Louis Stamping Co. 155 Mass. 267, 29 N. E. 623; Cook v. Burnley, 45 Tex. 97; McDowell v. Langdon, 3 Gray, 513; Downer v. Shaw, 22 N. H. 277; Chrisman v. Harman, 29 Gratt. 494, 26 Am. Rep. 387; Lea v. Lea, 99 Mass. 493, 96 Am. Dec. 772.” See also Carter v. Carter, 14 N. D. 66, 103 N. W. 425, to the same effect. In Geary v. Bangs, 138 Ill. 77, 27 N. E. 462, the court, in speaking on this identical point, said: “The next point made is that the special plea setting up the proceedings and final judgment in the mechanic’s lien suit presented a complete defense to the action in this case. The plaintiff’s right to a mechanic’s lien depended upon principles essentially different from *274those upon which his right to recover for his work and labor performed and materials furnished in an action of assumpsit are based. To maintain his lien he was required to allege and prove a case within the provisions of the mechanic’s lien law, and it is therefore apparent that he was liable to be defeated in that proceeding upon various grounds which would have no bearing upon his right to recover in assumpsit. Neither the plea, nor the evidence offered under it, indicated the'precise ground upon which the mechanic’s lien was denied, but only the general fact that the proceeding resulted in a final judgment denying the plaintiff his lien. We are therefore unable to see how the facts thus jxresented can be held to amount to a defense of res judicata,, or estoppel.” See also 23 Cyc. 1297-1309, and cases cited. Also Draper v. Medlock, 2 Ann. Cas. 650, and note (122 Ga. 234, 69 L.R.A. 483, 50 S. E. 113).
The foregoing sufficiently answers in a general way the various contentions of appellant, with the exception of the specifications challenging the correctness of the finding as to the reasonable value of the work and material furnished by said contractors in the construction of such building. It is undoubtedly true that the burden was on plaintiff to establish such reasonable value, but we think the finding challenged has ample support. In fact the only testimony offered at all consisted of the stipulation that a witness for plaintiff, if present and sworn, would testify “that the reasonable value of the materials, work, and construction of the building described in the complaint amounted to $16,355.15,” together with the proof as to the admission by defendant in his original answer in the foreclosure case of the fact that, after deductions for damages occasioned by failure to fully perform the contract, there remained due to the contractors only the sum of $1,792.92, payment of which sum was tendered to the contractors by him and such tender kept good by deposit. The trial court evidently accepted such admission as sufficient proof upon this issue, and we think he was fully warranted in so doing. It is well settled that such admission was competent ’ evidence of the fact thus admitted, where, as here, it was shown by the defendant himself that it was incorporated in his answer with his knowledge and consent. 1 Enc. Ev. 424, 425; O’Riley v. Clampet, 53 Minn. 539, 55 N. W. 740; 16 Cyc. 969 — 971.
The judgment of the District Court not only has ample support *275in the evidence, but it appears to be clearly just and free from error, and the same is accordingly affirmed.
Goss, J., not participating.