The court are all of the opinion that the rulings of the chief justice at the trial were right, and that judgment should be entered upon the verdict.
The agreement of the parties to the contract established a measure of damages for its violation, which makes it wholly unnecessary to consider what would be the legal rule in the absence of such express stipulation. The contract was for the delivery of a certain quantity of specific kinds of lumber and timber for building a bridge. The contract recites that “ it is distinctly agreed and understood by the parties to this contract, that if any portion of this timber is not delivered, or is rejected in accordance with the agreement as hereinbefore stated, the city of Lowell may supply the deficiency in such manner as the said committee may deem expedient, and any extra cost incurred by the city in obtaining the same over and above the price agreed to be paid under this agreement for the same, and any damages accruing to the city by reason of such delay, may be deducted from the money due the said Allen, and shall be paid by him to the city.” The defendant did not deliver all the lumber which he had agreed to deliver; and a part of that which he did deliver was rejected for not being of the quality which the contract required.
The first ground of defence is contained in the prayer for instructions which was made and refused, that the only remedy of the plaintiffs is by retaining in their hands the amount due for lumber supplied and accepted. But the contract expressly provides that any extra cost incurred in supplying the deficiency not only “ may be deducted from the money due the said Allen,” but it is added “ and shall be paid by him to the city.” It may be deducted, that is to say, if it can be; but at all events it shall be paid. Any other construction would leave the plain* *135tiffs without remedy, if the defendant had wholly refused to perform his contract, so that nothing would have become due to him from which a deduction could be made.
The other objection to the rulings at the trial is based upon the assumption that the plaintiffs, if they undertook to supply the deficiency caused by the defendant’s failure to perform his contract, must procure exactly the same quality of lumber which the defendant'had agreed to furnish, and could not recover compensation for the cost of any other. This is undoubtedly true as a general proposition ; but we do not think it is to be applied with literal and absolute exactness. The provision of the contract must be reasonably construed, in reference to its subject matter, and to the circumstances under which it was made. The plaintiffs had a bridge to build, to be completed within a certain time. It required a large amount of lumber of a particular kind. In supplying it, it was their duty to conform as nearly to the contract as possible. But the rule which the court gave Was the practical and just one, that the city was bound to procure lumber “ substantially the same in kind and quality ” with that which the defendant had failed to supply. It might not be in their power to find in the market the necessary quantity which should exactly correspond to it in every particular. But if they acted in good faith, and with reasonable care and diligence, .a slight deviation in quality would not be a departure from the limits which the contract allowed, to “ supply the deficiency in such manner as the committee may deem expedient.” Especially would this be so, when the difference in quality from that which the contract required was occasioned by the purchase of some small part of the lumber of inferior value. This could not be prejudicial to the defendant. He has surely no reason to complain of that which could not increase, and would probably diminish, the sum which he has to pay. Under the instructions given to the jury, the plaintiffs cannot have recovered more than the actual cost to them of lumber which was substantially the same as that which the defendant had agreed to supply; and any inferiority in the quality has been considered In the assessment of damages, so that it is their loss, and not hie. Judgment on the verdict.