
60 Wn.2d 820 (1962)
376 P.2d 436
M.F. HASTINGS, as Receiver, Appellant,
v.
CONTINENTAL FOOD SALES, INC., Respondent.[*]
No. 36225.
The Supreme Court of Washington, Department Two.
November 21, 1962.
*821 Joseph T. Pemberton, for appellant.
Culp, Dwyer, Guterson & Edwards, by Malcolm L. Edwards, for respondent.
HUNTER, J.
This is an appeal from a judgment in favor of the defendant (respondent) in an action by the plaintiff (appellant), receiver for Lynden Frozen Foods, Inc., to recover certain funds as a voidable preference.
Lynden Frozen Foods, Inc., was an insolvent corporation. On January 19, 1959, the affairs of the corporation were entrusted to five trustees to manage the business for the benefit of the existing creditors.
On September 15, 1959, the trustees entered into a written contract with the defendant Continental Food Sales, Inc. The pertinent provisions of that contract are as follows:
"IT IS AGREED as follows:
"1. Continental shall use its facilities and its best efforts to procure purchasers and effect sales of the 1959 pack of food products produced by Lynden Frozen Foods, Inc.
"2. Continental shall have the sole and exclusive right to sell said 1959 pack and to receive the commissions as hereinafter set forth for all sales from said pack to buyers located in the area described as follows: [area description omitted]
"3. Continental shall do the billing on the products it sells and shall receive payment of the purchase price therefor; and it is agreed that Continental shall remit to Lynden the moneys due Lynden after deduction of the brokerage fees as set forth in this agreement.
"4. Lynden shall pay to Continental the following brokerage fees for products in the 1959 pack sold by Continental or sold in the area as described herein in which Continental has the exclusive right to sell:
"Two per cent (2%) of the gross sales price on all copacker sales
"Three per cent (3%) on all other direct sales
"Five per cent (5%) on all sales where an associated broker is involved.
"5. It is agreed that this agreement constitutes a bilateral *822 contract between the parties and each party acknowledges that the mutual promises and undertakings herein assumed constitute present and valid consideration for the contract." (Italics ours.)
Pursuant to this contract, the defendant sold a large part of the 1959 pack to buyers within the exclusive territory. The payments for these sales were collected by the defendant, some prior to the appointment of the plaintiff as receiver and some subsequent to the appointment. The brokerage commissions for the defendant's sales were deducted from the amounts collected and there is no dispute between the parties as to the defendant's right to withhold those funds.
The dispute involved in this case relates to brokerage commissions for sales made within the exclusive territory by the trustees, prior to the plaintiff's appointment and without notice to the defendant. After the plaintiff was appointed as receiver for the insolvent corporation, the defendant inspected the books of the trustees and discovered the sales made within its exclusive territory. The defendant deducted the brokerage commissions for these sales, amounting to $3,444.79, from proceeds collected from buyers which it had procured.
The plaintiff commenced this action to recover, as a preference, the amount withheld by the defendant as commissions on the sales made by the trustees. The plaintiff acknowledged that the defendant had a valid claim to these commissions, according to the contract, but contended the claim is not a secured one and must be treated along with the other unsecured claims against the insolvent corporation.
The trial court, accepting the defendant's theory of the case, interpreted the contract between the parties as contemplating a security arrangement with respect to the defendant's right to collect payments for sales and to deduct the brokerage commissions. It held the security arrangement applied to commissions for all sales within the exclusive territory, whether or not such sales were made *823 by the defendant. Accordingly, the trial court found that the disputed amount withheld from the funds collected was not a voidable preference within the meaning of RCW 23.72.010 and entered judgment for the defendant.
The plaintiff has assigned error to the trial court's finding that the parties to the contract intended to create a security arrangement and to the conclusions of law drawn therefrom. The plaintiff argues that, upon the interpretation of the written contract, no security arrangement was contemplated as to commissions for sales other than those made by the defendant.
[1] A clear statement of the rule in determining the meaning of a written contract is set forth in Boeing Airplane Co. v. Firemen's Fund Indem. Co., 44 Wn. (2d) 488, 268 P. (2d) 654, 45 A.L.R. (2d) 984 (1954):
"The primary factor to be considered in determining the meaning of a written contract is the intention of the parties, and that intention normally is to be ascertained largely from the language employed by them....
"Where the terms of a contract taken as a whole are plain and unambiguous, the meaning of the contract is to be deduced from its language alone, and it is unnecessary for a court to resort to any aids to construction.... But where the language of a contract is ambiguous or susceptible of more than one meaning, it is the duty of the court to search out the intent of the parties by viewing the contract as a whole and considering all of the circumstances surrounding the transaction, including the subject-matter and the subsequent acts of the parties...."
The latter part of the rule is applicable here. Paragraphs three and four of the contract in the instant case read as follows:
"3. Continental shall do the billing on the products it sells and shall receive payment of the purchase price therefor; and it is agreed that Continental shall remit to Lynden the moneys due Lynden after deduction of the brokerage fees as set forth in this agreement.
"4. Lynden shall pay to Continental the following brokerage fees for products in the 1959 pack sold by Continental or sold in the area as described herein in which Continental has the exclusive right to sell:" (Italics ours.)
*824 [2] It is not clear whether the deductions permitted under paragraph three are limited to the proceeds of sales made by the defendant, or also include commissions from proceeds of sales made by the trustees, as provided in paragraph four. Therefore, the trial court properly considered the facts of the surrounding circumstances in making this determination. The defendant was aware of Lynden's insolvency when it entered into the contract. Since the packing season had ended, it was essential for the trustees to arrange for the sale of the "pack" in order to liquidate Lynden's assets. The contract clearly indicates it was the intention of the parties that the commissions for defendant's sales be protected. Therefore, it would be consistent and reasonable to conclude, in view of the above circumstances, that the parties also intended all commissions owing to the defendant under the contract be protected.
[3] The record supports the finding of the trial court that the parties intended to establish a security arrangement to assure the defendant the payment of all commissions, as provided by the contract. The law relating to equitable assignments is applicable. The defendant acquired a security interest in the proceeds of all the sales to the extent of its commissions. Whiting v. Rubinstein, 7 Wn. (2d) 204, 109 P. (2d) 312 (1941); Terhune v. Weise, 132 Wash. 208, 231 Pac. 954, 38 A.L.R. 94 (1925).
[4] The defendant's lien related back to the time the security arrangement was entered into and the amount withheld, which is in dispute here, was not, therefore, a voidable preference.
The judgment is affirmed.
FINLEY, C.J., DONWORTH, OTT, and HAMILTON, JJ., concur.
NOTES
[*]  Reported in 376 P. (2d) 436.
