
515 P.2d 446 (1973)
30 Utah 2d 187
THOMAS J. PECK & SONS, INC., a Utah corporation, Plaintiff and Appellant,
v.
LEE ROCK PRODUCTS, INC., a Utah corporation, Defendant and Respondent.
No. 13167.
Supreme Court of Utah.
October 30, 1973.
*447 Heber Grant Ivins, American Fork, Dallas H. Young, Jr., Provo, for plaintiff and appellant.
Jackson B. Howard of Howard, Lewis & Petersen, Provo, for defendant and respondent.
CROCKETT, Justice:
Peck, owner and lessor of a gravel pit north of Lehi, sued defendant Lee, lessee, to have the lease declared invalid and unenforceable, to restrain removal of gravel, and for damages. The district court first granted a temporary injunction against Lee, then recalled the order. On plaintiff's claim that irreparable damage was occurring, and that a final adjudication as to the status of the lease was desirable before trying the issues as to damages, this court granted an intermediate appeal.[1]
Lee Products, which was engaged in the sand and gravel business, had had its lease on another gravel pit owned by Provo City expire in the summer of 1971. Lee's attorney prepared a proposed lease on Peck's property: that he would install his equipment in the pit and pay five cents per ton for the materials removed. Peck says (and other evidence so indicates) that this was a very low price, and that he would not agree to such a lease unless he had an option to buy Lee's equipment after it was installed.
Pursuant to this proposal Mrs. Peck typed up the following:
Added Option
Upon mutual agreement between Clinton L. Lee and Thomas J. Peck, Thomas J. Peck shall have the option to buy the equipment and business from Clinton L. Lee for the price to be mutually agreed upon by both parties at any such time after business is in complete operation. The price shall be determined by two competent appraisers and agreed upon by both concerned parties  Lee and Peck.
The payment is to be mutually agreed upon by both parties.
After this addition, the parties signed the agreement on August 19, 1971. Lee proceeded to install his equipment and get it into operation, with some help and cooperation from Peck. Incidentally, some of the gravel was sold to Peck at a charge of fifty cents per ton. The following spring, on March 17, 1972, Peck's attorney wrote a letter to Lee proposing to exercise the option to buy Lee's equipment. Lee's counsel responded by letter of March 28, rejecting Peck's proposal on the ground that the "Added Option" was not binding because it constituted only an agreement to agree. The impasse thus created resulted in this lawsuit.
The basic controversy in this case is posed thus: The plaintiff's position is that the entire lease, including the "Added Option" constitute one integrated agreement, which he would not otherwise have entered into; and that the option should be enforced; and alternatively, if the option is not enforceable, it is an integral part of the entire contract, and the whole contract is therefore unenforceable, and that the defendant *448 is on plaintiff's property without right as a trespasser.
Whereas, the defendant's position is that the "Added Option" is but an agreement to agree and therefore unenforceable. But he urges that it should be regarded as something separate and severable from the primary lease, and that the latter is a valid agreement under which he can remove gravel at five cents per ton.
On the basis of the evidence presented by the parties on the dispute just stated the trial court made "interlocutory" Findings of Fact and Conclusions of Law, upon which he entered the following Interlocutory Judgment and Decree:
1. The purported Lease Agreement with Added Option dated August 19, 1971, constitute one integrated indivisible instrument, which, because the Added Option is unenforceable, causes the entire instrument to be unenforceable as such and is a voidable, but not void, instrument.
2. The defendant is a tenant of the plaintiff by estoppel and the plaintiff is estopped from denying that the defendant is a lessee of the said property, the terms and conditions of said lease being those expressed in the Lease Agreement, with the exception that the term of the said lease is from year to year.
3. The Court has, by previous order, reserved for trial the issue of the defendant's damages by reason of the wrongful issuance of the injunction, and the Court reserves for trial the issues of the indebtedness, if any, of one party to the other for the purchase of materials between the said parties.
In attempting to overturn the trial court's ruling that the lease and the "Added Option" were intended to be one integrated transaction the defendant argues for application of the principle that if the two agreements can be segregated and carried out separately, that should be done. The soundness of that doctrine in appropriate fact situations is not doubted.[2] But the trial court appears to have been concerned with other basic principles of contract law, which have more specific application to the instant fact situation. The most fundamental of these is that the meaning and effect to be given a contract depends upon the intent of the parties;[3] and that this is to be ascertained by looking at the entire contract, and all of its parts in their relationship to each other; and this principle applies to whether they intended separate aspects of their contract to be severable,[4] and that if this results in uncertainty, he may and should look to extraneous evidence concerning the background and surrounding circumstances in order to make that determination.[5]
In following that course, the court accepted the version of the transaction as presented by the plaintiff: That the lease as proposed by defendant was unacceptable, and that the "Added Option" was agreed to as a part of one entire "single package" transaction, and without which the lease would not have been executed. We must assume that the trial court believed the evidence as presented by the plaintiff; and this constitutes substantial evidence to support the view he thus adopted. Moreover, on the vital point of intent, there is this further observation which tends to support the trial court's ruling. Lee is faced with a dilemma: Either he thought the option as proposed by Peck was valid, and he was acting in good faith in agreeing to it as an essential part of a total contract, or he thought otherwise. If the former, then the trial court correctly so held. On the other hand, if Lee did not so intend, then he must have known the "Added *449 Option" was but an illusory, unenforceable promise. If this were true, then he acted in bad faith to induce Peck into signing a contract which he knew Peck would not otherwise agree to. On the basis of what has been said above we are not convinced that the interests of justice would be served by overturning the determination made by the trial court.
The plaintiff, gratified by the ruling of the trial court on the above discussed issue as to the contract, nevertheless takes his turn in attacking the findings and judgment. He argues that inasmuch as the lease is invalid, it follows that the defendant is but a trespasser, and that the trial court committed error in refusing to so find. We think the court was well within his prerogative in rejecting this contention of the plaintiff. He acted correctly and in accordance with the law in determining that the lease was not void, but was voidable and unenforceable, and that because the defendant went into possession by consent under the lease, he was not a trespasser, but a landlord and tenant relationship arose. The law is stated at 49 Am.Jur.2d 89:
The authorities generally agree that entry and occupation and payment of rent under an invalid and unenforceable lease, ... result in a legal relation of landlord and tenant ... .
That text explains that the tenancy is not dependent on the terms of the invalid lease, but is implied by the law from the occupancy of the premises under an agreement, and that such a tenant cannot justly be treated as a trespasser.
The question then arises as to what are the rights of the parties under that type of landlord and tenant relationship. In the absence of an express agreement between them, the law necessarily implies that they will meet their obligations to each other on terms that are reasonable and fair to both. The landlord is entitled to reasonable compensation, and to be restored to the possession of his property; and the tenant is entitled to a fair and reasonable opportunity to cease his operation, remove his equipment, and vacate; and there should be whatever adjustment of accounts between them is necessary to accomplish that objective.
The courts have looked at this problem variously and have arrived at different solutions.[6] Some have ruled that a tenancy at will is created.[7] But a greater number hold that the tenancy should be month to month,[8] or year to year.[9] A basic principle which seems to emerge from these cases is that even though the lease be invalid, its terms may be looked to and given some consideration, along with other factors, in arriving at what is fair and reasonable in adjustment of the rights of the parties.
Considering the various pertinent factors involved here, including the facts concerning the installation of substantial equipment; and the fact that the proposed lease was on a yearly basis for five years with option to renew, the trial court also acted within his prerogative under the circumstances in ruling that the lease should be regarded as "from year to year," and also in reserving for trial the issues as to the indebtedness of the parties to each other.
Some tempest has been raised about the court allowing the plaintiff to make tardy amendments to the pleadings. In doing so he wisely and properly stated:
The pleadings are never more important than the cause that is before the *450 court... . There can be no prejudice in this case because we'll give ample time for any answer ... .
This is in harmony with what we regard as the correct policy: of recognizing the desirability of the pleadings setting forth definitely framed issues, but also of permitting amendment where the interest of justice so requires, and the adverse party is given fair opportunity to meet it.[10] Upon remand for further trial the parties will have the required opportunity to meet the issues raised.
The interlocutory Findings of Fact, Conclusions of Law and Judgment are affirmed; and the case is remanded for the further trial and final determination of the remaining issues. The parties to bear their own costs. (All emphasis added.)
CALLISTER, C.J., and HENRIOD, ELLETT and TUCKETT, JJ., concur.
NOTES
[1]  As permitted by Rule 72(b), U.R.C.P.
[2]  As to tests of severability of agreements see 17 Am.Jur.2d 760; Knapp v. Strauss, 227 Mo. App. 822, 58 S.W.2d 805; Baker v. Jones, 69 Wyo. 314, 240 P.2d 1165.
[3]  Jensen's Used Cars v. Rice, 7 Utah 2d 276, 323 P.2d 259.
[4]  Coppedge v. Leiser, 71 Idaho 248, 229 P.2d 977; Restatement of Contracts, Section 235.
[5]  Continental Bank & Trust Co. v. Bybee, 6 Utah 2d 98, 306 P.2d 773.
[6]  See Annotation 6 A.L.R.2d 685 and cases there treated.
[7]  Allan Grayson Realty v. Stone Mountain Industrial Park, 113 Ga. App. 362, 148 S.E. 2d 51; Hixon v. Starr, 242 Mass. 371, 136 N.E. 186.
[8]  Kevich v. R.L.C. Inc., 173 Cal. App.2d 315, 343 P.2d 402; Stuber v. Sowder, 168 Kan. 467, 213 P.2d 989.
[9]  Frank v. Flynn, 120 Ohio App. 361, 197 N.E.2d 657; Eliason v. Eliason, 151 Mont. 409, 443 P.2d 884; Darling Shops Delaware Corp. v. Baltimore Center Corp., 191 Md. 289, 60 A.2d 669.
[10]  Rule 15(b), U.R.C.P., provides for amendments to conform to the evidence; and see Taylor v. E.M. Royle Corp., 1 Utah 2d 175, 264 P.2d 279; Buehner Block Co. v. Glezos, 6 Utah 2d 226, 310 P.2d 517.
