
198 N.W.2d 139 (1972)
William S. BEATTIE, Appellant,
v.
PRODUCT DESIGN & ENGINEERING, INC., et al., Respondents.
No. 42565.
Supreme Court of Minnesota.
April 21, 1972.
Rehearing Denied June 16, 1972.
Herbert C. Davis, St. Louis Park, for appellant.
Dorsey, Marquart, Windhorst, West & Halladay, and James B. Vessey and Robert A. Heiberg, Minneapolis, for respondents.
Heard before KNUTSON, C. J., and MURPHY, OTIS, KELLY, and ODDEN, JJ.
*140 DONALD C. ODDEN, Justice.[*]
Plaintiff, William S. Beattie, appeals from an order of Hennepin County District Court denying his motion for a new trial. The action was commenced against Product Design & Engineering, Inc., and A. J. Porter to recover royalties allegedly due to plaintiff under the provisions of an agreement entered into by the parties on June 12, 1961. Before trial, plaintiff dismissed his action against Porter. In denying relief, the court held, in substance, that the agreement to pay royalties was predicated upon the patentability of the device in question and that obtaining a patent was a condition precedent to such payment. We find this interpretation of the agreement contrary to our established rules of construction and accordingly reverse.
In 1960, plaintiff, a salesman for Container Supply Company of Kansas City, Missouri, a wholesaler of plastic packaging products and factory representative for manufacturers of such products, was told by a representative of H. B. Fuller Company that that company was interested in purchasing a self-cleaning plastic closure for its plastic bottles of white glue. Plaintiff developed a series of ideas in an effort to design a plastic closure which would meet the requirements described to him by the H. B. Fuller representative and approached A. J. Porter, president of Product Design & Engineering, Inc. (hereafter P D & E), with his idea for a design for a closure basically consistent with what later became known as the "tip-lock" closure. Plaintiff and Porter worked on this closure cooperatively during the winter and spring of 1961, with Porter supplying professional engineering skills to the idea originated by Beattie, and produced prototype models of the closure which were submitted to the Fuller Company for testing and evaluation. Upon acceptance by the H. B. Fuller Company of the closure design, an agreement was prepared by an officer and legal counsel for P D & E which reduced to writing the understanding between plaintiff, Porter, and P D & E. In that agreement, which the parties executed in the offices of P D & E's legal counsel on June 12, 1961, Porter had himself designated as coinventor of the "tip-lock" closure. The agreement reads as follows:
"THIS AGREEMENT, made and entered into this 12 day of June, 1961, by and between Product Design & Engineering, Inc., hereinafter referred to as P D & E, A. J. Porter, hereinafter referred to as Porter and William S. Beattie, hereinafter referred to as Beattie.
"WHEREAS, P D & E, a Minnesota corporation, engaged in, among other things, the manufacture and distribution of plastics commodities, and
"WHEREAS, Porter and Beattie are co-inventors of a certain device generally described as `plastic tip-lock cap for containers', and
"WHEREAS, P D & E is interested in the exclusive manufacture and distribution of said device and Porter and Beattie are interested in assigning all of their interest in said device to P D & E, and
"WHEREAS, Beattie is interested in becoming employed by P D & E,
"NOW, THEREFORE, in consideration of One Dollar ($1.00) and other good and valuable consideration and the mutual promises herein contained, the parties agree as follows:
"I.
"P D & E agrees to employ Beattie as a salesmanager of its proprietary plastics products department within one year from the date hereof. P D & E agrees to pay to Beattie a minimum salary of Ten Thousand ($10,000.00) Dollars per year and agrees that he shall have a contract for not less than one year containing the above mentioned salary or some *141 other negotiated salary figure and that the other provisions of said contract shall be those normally found in an employment contract.
"II.
"In addition to the consideration mentioned in Paragraph I, P D & E agrees to grant Beattie in the event he becomes employed by P D & E, an option to purchase five thousand (5,000) shares of the unissued common stock of P D & E. The option shall provide that Beattie shall purchase a minimum of one thousand (1,000) shares per year and a maximum of two thousand five hundred (2,500) shares per year and that in the event he has not purchased the five thousand (5,000) shares within five (5) years, this option shall expire. The option price of the stock shall be $1.15 per share, and further that the market value of such stock on the date of this agreement is $1.00 per share. The parties also agree that this stock option is not transferable except by will or descent and during the lifetime of the employee, must be exercisable only by him. The parties also agree that this option shall automatically be cancelled on the date that Beattie shall leave the employment of P D & E for any reason.
"III.
"Porter and Beattie are co-inventors of a certain device presently referred to as `plastic tip-lock cap for containers.' They agree to immediately file a patent application on said device as it now exists or may be modified and in consideration of the promises herein contained agree to assign all of their rights to said device and patent application as it now exists or may be modified to P D & E. Said assignment shall be made upon the making of the patent application. P D & E agrees to pay all costs in connection with the filing and prosecution of said patent application, and Porter and Beattie agree to prosecute the patent application with diligence.
"IV.
"It is agreed that in the event that Porter or Beattie sever their employment for any reason with P D & E, P D & E agree to pay to each a royalty on the sale price received by P D & E the sum of three percent (3%) of the gross sales of the product or products covered by the claims of the patent application or the claims of a patent as it may be issued as a result of said application. It is further agreed that in the event that if either Beattie or Porter leaves the employment, that they shall have a right to inspect the books of P D & E at the end of the fiscal year which is December 31 in order to determine the gross sales of the product or products covered by the claims of the patent application or the claims of a patent as it may be issued as a result of said application.
"V.
"Porter and Beattie agree that they will not at any time acquire a domestic or foreign patent, the claims of which will be infringed by the construction of the `plastic tip-lock cap for containers' as herein described.
"VI.
"This contract is separable and if any provision herein is found to be invalid or is deleted by mutual consent or otherwise the parties agree that such invalidity or deletion shall not affect the other provisions in the contract."
Beattie entered into employment with defendant under the terms of this agreement on or about the date upon which the agreement was executed, and shortly thereafter he and Porter approached the Borden Company to sell the closure to that company for use with its white glue product known as Elmer's Glue. The parties were successful in interesting Borden in the closure and secured substantial orders from it, but Borden insisted that no sales of the closure be made to dispensers of white glue other than *142 Borden and H. B. Fuller Company. Production of the closure was undertaken by P D & E as its first proprietary plastic product, and production quantities were first achieved in September or October of 1961.
An application for patent of the closure was filed by P D & E on June 19, 1961, and was rejected by the United States Patent Office on June 7, 1962. In November 1962, an amended application for patent was filed by defendant. This application was rejected on March 12, 1963. An appeal was taken from that decision, and on April 15, 1964, the Board of Appeals sustained the decision of the examiner rejecting the application for mechanical patent. Defendant was notified that further appeals were possible but would be costly, and nothing further was done regarding the application for mechanical patent. Plaintiff did not participate in any of the proceedings relative to the application for mechanical patent, nor was he consulted in any way regarding the decision of defendant to proceed no further with the patent application.
Shortly after production quantities were first achieved and before any disposition had been made on the application for a mechanical patent, defendant was notified by Halkey-Roberts Company that the "tip-lock" being produced by P D & E infringed a patent owned by Halkey-Roberts. Patent counsel for defendant advised it that the "tip-lock" did infringe some of the claims of the Halkey-Roberts patent and recommended commencement of a declaratory judgment action. Defendant, apparently out of a desire not to risk losing the large Borden contract, chose not to initiate court action. Instead, defendant and Halkey-Roberts entered into a license agreement whereby defendant obligated itself to pay to Halkey-Roberts a royalty of 4 percent of the gross sales of the closure. In that agreement, defendant admitted the validity of the Halkey-Roberts patent and agreed not to contest the same. The license agreement between defendant and Halkey-Roberts was entered into between them in December 1961, and again plaintiff was not consulted in any way nor did he participate in any of the proceedings between defendant and Halkey-Roberts.
On May 22, 1962, defendant filed an application for a design patent for the "tip-lock" closure, and a Design Letters Patent was issued in response to that application on February 5, 1963. Plaintiff executed a second assignment to defendant on May 17, 1962, at the request of A. J. Porter, president of defendant, in which the following recitals were contained:
"Whereas, We, Alvin J. Porter and William S. Beattie of Hopkins, Minnesota and Richfield, Minnesota, respectively, have invented a certain improvement in a design for a Cap For Dispensers for which we are about to make application for United States Design Letters Patent; * * *
"* * * [W]e, Alvin J. Porter and William S. Beattie, by these presents do sell, assign and transfer unto said Product Design & Engineering, Inc., the full and exclusive right for the territory of the United States of America and for all foreign countries in and to said invention, as described in the application executed by us on the 9th day of May, 1962, preparatory to obtaining Design Letters Patent of the United States therefor; said invention, application, and Letters Patent to be held and enjoyed by said Product Design & Engineering, Inc., for its own use and behoof, and for its legal representatives, to the full end of the term for which said Letters Patent may be granted, as fully and entirely as the same would have been held by us had this assignment and sale not been made.
* * * * * *
"And further the undersigned agree that they will, at any time upon request, communicate to said Product Design & Engineering, Inc., its successors, assigns or legal representatives, such facts relating to said invention and Letters Patent *143 or the history thereof as may be known to us, and testify as to the same in any interference or other litigation when requested so to do." (Italics supplied.)
Meanwhile, in the fall of 1962, plaintiff was demoted from his position as national sales manager of defendant's plastic products division, and finally on December 31, 1962, his employment with defendant company was terminated entirely. Plaintiff's termination of employment was not voluntary but was the result of being fired by Porter for reasons not material to this lawsuit.
Following termination of his employment, plaintiff, on November 19, 1963, made a demand for royalties pursuant to the initial agreement. P D & E refused, and in 1965 this action was commenced. For various reasons, disposition of the matter was delayed, and in February 1970 the matter was tried to the court without a jury.
The trial court found that the consideration for defendant's obligation to pay royalties was the right to exclusive distribution of the "tip-lock" closure, hence, the notice of infringement given by Halkey-Roberts produced a failure of consideration such that the royalty agreement was rendered unenforceable. The court further found that the agreement contemplated only items produced by P D & E pursuant to the claims of the mechanical patent, and that since no patent was issued, P D & E became legally entitled to manufacture the item without payment of royalties. In addition, the court found that the royalty agreement contemplated a mechanical patent, not a design patent, and that in any event the design patent issued was invalid. The court concluded that plaintiff was not entitled to royalties.
On appeal, plaintiff raises two issues: (1) Whether the trial court's construction of the agreement of June 12, 1961, was supported by the evidence; and (2) whether the trial court was justified in determining the invalidity of the design patent for the "tip-lock" closure.
The agreement of June 12, 1961, entered into between plaintiff, Porter, and defendant purported to incorporate the terms of an understanding between them. It was prepared by defendant's attorney who was at the time of the drafting of the instrument an officer of defendant as well as its attorney. There has been no claim throughout any of the proceedings that the agreement did not express the intention of the parties, or that it was subject to reformation because of fraudulent representations of the plaintiff or upon the grounds of mutual mistake of fact. Thus, according to the established law of Minnesota, since the agreement in question was prepared by the defendant, all doubts or ambiguities must be resolved against the defendant. 4 Dunnell, Dig. (3 ed.) § 1832; Marso v. Mankato Clinic, Ltd., 278 Minn. 104, 153 N.W. 2d 281 (1967); Koch v. Han-Shire Investments, Inc. 273 Minn. 155, 140 N.W.2d 55 (1966). Another established rule of construction, as stated in 17 Am.Jur.2d, Contracts, § 246, quoted with approval in Marso v. Mankato Clinic, Ltd. supra, is as follows:
"In construing or interpreting contracts and ascertaining the intention of the parties thereto, the contracts are to be considered in the frame of reference of their subject matter, their nature, and their object or purpose. The spirit and purpose of a contract, as well as its letter, must be regarded in the construction and effectuation thereof, and there can be no doubt that the court may look beyond the form into which the parties have cast their agreement. In fact it is the substance of an agreement rather than its form  the spirit and purpose rather than the letter  which must control its construction. The subject matter and the purpose of the contract are material to the ascertainment of the intention of the parties and the meaning of the terms they used, and when these are ascertained, they must prevail over the dry words of the agreement. If the general purpose of a contract is ascertained, the language of its provisions *144 must be construed with reference to that purpose and so as to subserve it. It is always of much importance in the construction of a contract upon which doubt arises to ascertain what was the attitude of the parties to the subject and to find out what was their main purpose and object in making it. If this can be done, the terms of the contract will be so construed as to promote the main purpose, if the language employed will fairly permit such construction."
It would seem that the purpose of plaintiff, Porter, and defendant was obvious; all wanted to take the idea for the "tip-lock" closure which Beattie and Porter had developed, adapt defendant's plant to production of that closure, and sell the completed product to the Borden Company, the H. B. Fuller Company, and any other person or company which could use it for products other than white glue. The arrangements with Borden and Fuller were concluded long before the patent application was first turned down. By that time, regardless of the outcome on its patent application, defendant had already expanded its production and sales tremendously. Thus, the eventual denial of the patent did not affect the total production and sale of the closure in any way. We agree that profits may have been affected by the alleged infringement of the Halkey-Roberts patent, but the decision not to challenge the infringement claim was made by defendant without consulting plaintiff in any way. We fail to see how a subsequent unilateral decision by defendant can be said to destroy plaintiff's right under an already existing contract. The successful production and sale of the closure, not the obtaining of the patent, was the real purpose behind the agreement between plaintiff, Porter, and defendant.
In the agreement plaintiff agreed to assign his rights to the device and patent application and promised to prosecute the patent application with diligence. At no time did he warrant that a patent would be obtained or even that the closure was patentable; similarly defendant, who drew the contract, at no time stated that obtaining a patent was a condition precedent to payment of royalties. The agreement further provided that defendant promised to pay royalties on the sale of the product covered by the claims of the patent application or the claims of the patent. There can be no serious assertion that the closure designed by Beattie and Porter is not the product covered by the claims of the patent application. If, as defendant asserts, the securing of a patent was a condition precedent to the contract, there would have been no need to refer to the product covered by the patent application, as well as the product covered by the patent.
Under our established rules of construction set out above, we must construe a contract in a manner designed to achieve the purpose of the contracting parties; if doubt still remains, we must construe the contract against the party who drafted it. We therefore find no basis for holding that obtaining a patent on the closure in question was a condition precedent to the contract and to plaintiff's right to receive royalties.
Since we find that the obtaining of a patent was not a condition precedent to the contract and payment of royalties, we need not examine questions relating to the design patent.
Reversed and a new trial granted on issue of damages only.
TODD, J., not having been a member of this court at the time of the argument and submission, took no part in the consideration or decision of this case.
NOTES
[*]  Acting as Justice of the Supreme Court by appointment pursuant to Minn.Const. art. 6, § 2, and Minn.St. 2.724, subd. 2.
