delivered the opinion of the court.
This is an action on a fire insurance policy for $10,000. There was a verdict and judgment for the plaintiff for $2,537.63, and the defendant obtained this writ of error.
The parties will be referred to with respect to their positions in- the trial court.
The plaintiff claimed on this policy only $9,767.40 of principal, of which $7,732.38 was paid into court, and the verdict was for the difference of $2,035.02, principal, and $502.61, interest to December 6, 1922.
*382The policy provided as follows:
“This policy for a total liability of $10,000.00 covers a pro rata share of each of the following items:
“$9,000.00 on frame, metal roof buildwgr, including foundations, adjoining and or communicating additions, permanent fixtures and apparatus for lighting, mill-wright work, tramways within 100 feet of the building, and'all other permanent fixtures and improvements as a part of the building occupied and used for saw and planing and dry kiln purposes. (Italics supplied.) -
“$14,000.00 on carriages, saws, cutters and all other machines, machinery, connections, appliances and devices of every kind and description not insured under items Nos. 1 and 3.
“$1,200.00 on trucks, tools, spare parts and mills up-plies of every kind and description, not insured under item No. 2.
“$800.00 on cement and brick, metal roof building, including foundations, adjoining and communicating additions and all other permanent fixtures and improvements as a part of the- building, occupied as boiler and engine room.
“$5,000.00 on boilers, engines, settings, stacks, piping, connections, and all other machinery, engines, supplies and devices, while contained in the above described building.
“All the above described property situated at Damascus, Virginia.
“Average Clause.
“It is understood and agreed that the amount insured by this policy shall attach in each of the above named premises in that proportion of the amount hereby insured that the value of the property covered by this *383policy, contained in each of said places, shall bear to the value of such property contained in all of the above named premises.”
The plaintiff held two other policies in the same form in two other companies, for the sum of $10,000.00 each, its total insurance being $30,000.00.
The saw mill and planing mill were connected by a structure eighty feet long, which contained the chain conveyor. The floor of this structure, on which the chain conveyor was located, connected the floor of the saw mill department with the floor of the planing mill department, all three floors being on the same level. The saws and planer were connected with the same line shaft and the roof which covered the conveyor connected with the roofs of the saw mill and planing mill, though this roof did not extend the entire length of the conveyor.
The saw mill department of the saw and planing mill building was partially destroyed by fire. The planing mill department and the dry Min were not burned, but the total loss of the Damascus Lumber Company exceeded $83,000.00.
It is agreed that the dry Min, which was located more than eighty feet from the saw mill, was a separate building; but the plaintiff contends that the saw mill and the planing mill were one building, while the defendant asserts that they constituted two buildings.
The average clause has no application and is never used where the policy covers only one building. It is always used where the assured desires a blanket policy covering two or more buildings. Under such circumstances, this clause is manifestly just to both the insurer and the insured. Without it the owner of four buildings, worth $10,000.00 each, could secure a blanket policy on them, and collect $10,000.00 upon the burning *384of either building. In other words, the insurer would be carrying the risk on $40,000.00 worth of property for a premium on a $10,000.00 policy. The average clause simply apportions the insurance among the several locations, so that it will attach at each location in that proportion of the total amount of insurance that the value of the property covered by the policy, contained in each location, shall bear to the value of the property contained in all of the locations.
It follows, that under the average clause, where the property is burned at only one location, the amount of the liability of the insurer will depend largely upon the number of different buildings, or locations, covered by the policy.
It is not controverted that, under the average clause, there should be deducted from each policy the proportionate amount of insurance on the building or buildings which were not burned.
On the theory that the saw mill and planing mill were two buildings, the defendant admitted liability to the extent of $7,732.38, but refused to pay the $2,035.02. which was the balance due, if the saw and planing mill were one building.
It was agreed at the bar of this court that the only question for decision is whether, under the average clause, the policy covered two buildings or three buildings; that if only two the judgment should be affirmed; if three the judgment should be reversed.
Were the jury warranted in finding that the saw and planing mill were one building, and that the policy cov- _ •ered only two buildings?
Contracts of insurance are to be liberally construed in favor of the insured. North British, etc., Co. v. Robinett & Green, 112 Va. 754, 72 S. E. 668; Day v. *385Home Ins. Co., 177 Ala. 600, 58 South. 549, 40 L. R. A. (N. S.) 652.
It is the duty of the court to construe all written agreements relied on to make a contract. But where ambiguous words in a contract are to be construed in the light of extrinsic evidence, or the surrounding circumstances, the meaning of such words becomes a question of fact for the jury, and the court’s construction is based upon the meaning of the words as ascertained by the jury. Clark on Contracts (3d ed.), section 218; Smith on Contracts, side page 464.
The contract sued on reads in part, “$9,000.00 on frame, metal roof build-mgr, including foundation, etc., * * * occupied and used for saw and planing and dry kiln purposes.” (Italics supplied.) This language standing alone, unexplained by the surrounding circumstances, would certainly seem to indicate that the business of sawing, planing and kiln-drying lumber was all conducted in one building. But it appears from the evidence that the dry kiln is an independent building situate detached ninety feet from the planing mill. The uncontroverted evidence further is that the building in which the sawing is done is connected with the building where the planing is done by a partially enclosed platform on which is located a chain conveyor which carries the lumber from the saw to the planer; that all the power for the saws and planers came from two large engines in the boiler house attached to the saw mill; that belts and line shafting connected the saw mill, through the structure for the chain conveyor, with the planing mill; that the roof of the structure for the chain conveyor was connected with the roof of the saw mill and the roof of the planing mill; that the Virginia Inspection and Rating Bureau issued a rate slip fixing the rate on plaintiff’s “saw and planing mill” at $5.65, with a deduc*386tion of twenty-five cents if boilers and engines are specifically insured; that for three years fifteen insurance companies carried insurance on the saw and planing mill as one building, the policies being written without the average clause; and that when the dry Min was later erected the policies were endorsed so as to cover it, and the average clause was then attached to them.
In addition, three witnesses with large experience in the construction and operation of saw and planing mills testified that the saw mill and planing mill in question were one building, while one or more witnesses for the defendant testified they were two buildings.
When the contract is read in the light of all the surrounding circumstances, and the conduct of the parties, it seems reasonably certain that they intended the saw and planing mill to be insured as one building.
Besides, the jury and the trial judge viewed the premises and had an opportunity to test the evidence by the physical facts..
Upon a fair and impartial hearing the jury, after being properly instructed, has decided that the policy covered only two buildings, and the judge who heard the witnesses testify and viewed the premises, has entered judgment thereon, and we find no reason to disturb it.
Affirmed.