The original bill filed by the aj>pellants states, in substance, that they are, and were the owners of three parcels of lands situate in the city of Opelika, known and designated as lots 2, 3 and 4 in block A. These lots formed one *532“eom/pact settlement ,” on which was the residence of the appellant, George D. They are bounded by thi;ee of the streets of the city,, known as Washington street, North Nailroad street and Coosa street, and separated from Wilcox street by lot 1 of said block. On and before the 6th day of September, 1870, the Savannah & Memphis Nailroad Company had constructed its road-bed through lot numbered 4, and through a small corner of lot 3. On that day the railroad company and the appellants entered into an agreement in writing, a copy of which is exhibited, by which the company stipulated to pay the appellants in cash three hundred and seventy-five dollars, and also stipulated to do certain work upon the streets aforesaid where they were intersected by its road. In return, the appellants were to give the company the right to run their road through said block on the bed as graded, and the use of all of lot 4 on the north side of the road, and the right of way to the extent of twenty-five feet from the centre of the road-bed. The company stipulated to do and perform all of the work on the streets on or before the first day of June, 1871. For any failure after that time, they stipulated to pay the appellants one dollar per day, for each day they were in default. Each party stipulated, on the request of the other, to execute any other or further deeds Qr instruments necessary to give effect to their intentions and purpq¡ff$„
The company made payment of said sum of three hundred and seventy-five dollars, entered into possession of the parts of the lots on which the road-bed was constructed, and of the twenty-five feet from the centre of the bed, and of the part of lot number 4 north of the road, and have since had undisturbed occupancy. They have failed and neglected to do the work stipulated on Coosa street, or on North Nailroad street, and in consequence said streets are useless as ways to and from lots 2 and 3, and the part of lot 4 reserved by the appellants. And they have also failed to provide, on Wilcox street, the crossing agreed to be provided. They have failed and neglected to pay or tender to the appellants “the amount stipulated in said agreement as liquidated damages for its default in relation to the crossings or any part thereof, or any compensation in any shape whatever.”
It is alleged the agreement of the company to do the stipulated work on the said streets, or failing therein, to pay certain damages, was a part of the consideration of the purchase of the right to, and use of the lands of which it has possession under said agreement. The insolvency of the company is averred, and its execution of a mortgage conveying all its property, for the foreclosure of which proceedings were pending in the Court of Chancery.
The prayer of the bill is, that a decree be rendered for the payment to the appellants of the sum of one dollar per day for *533the period the company has been in default in the performance of the said work; that a lien for the payment thereof be decreed on the lands it acquired under said agreement; and that the company and its assignees be compelled to do and maintain said work, and the agreement declared a perpetual lien for compelling them to do and maintain the same, and for general relief.
The hearing in the Court of Chancery was had on motion to dismiss the bill for want of equity, no demurrer or answer having been filed. The chancellor was of opinion, that the bill could not be regarded as the bill of a vendor claiming a lien for 'the purchase-money; that it was a bill for the recovery of stipulated damages, stating no fact rendering necessary the interference of a court of equity, and could not be entertained. Therefore, the motion was sustained and the bill dismissed.
It is not an uncommon error to suppose that, under the principles and rules governing our courts of chancery, a motion to dismiss a bill for want of equity, and a demurrer are equivalents — that any and every objection which would be available on demurrer, is equally available as the ground of a motion to dismiss. The motion to dismiss has its authority in the 76th Buie of Chancery Practice, which reads: “A defendant may, at any stage ■of the cause, move. „o dismiss a bill for want of equity, unless a similar motion has been previously made and determined. If the cause is ready for hearing on bill and answer, or pleadings and proof, such motion mav be made and heard in connection with the final hearing.” Like the general demurrer which was usual in our practice prior to the Code, a motion to dismiss a bill for want of equity directs attention wholly and exclusively to the equities of the bill, not to its frame, or the want or misjoinder of parties, or other matter, which, if a demurrer were interposed, would be regarded as waived, if not specially assigned. ■ The present bill may be open to criticism, there may be defects in its frame, and omissions of proper averments adapting it to the particular relief to which the complainants may be entitled. These defects, if made the cause of demurrer, are curable by amendment, but do not form proper matter of a motion to dismiss for want of equity. That motion should prevail only, when admitting all the facts apparent on the face of the bill, whether well or illy pleaded, the complainant can have no relief whatever. If it is apparent, upon a proper statement of the facts and an appropriate prayer, equitable relief may be obtained, the motion should be overruled, the respondent put to his demurrer, or leave granted the complainant to amend, obviating the defects in the bill. Such is the course of practice in Tennessee under a statute similar in terms to our *534rule of practice. — Thompson v. Paul, 8 Humph. 114; Quinn v. Leake, 1 Tenn. Ch. 67; Randall v. Payne, Ib. 137.
The important, controlling question is, whether, under the facts stated in the bill, a case of equitable cognizance can be presented, when these facts are properly pleaded. The just construction of the contract into which the parties entered, their objects and purposes, must be ascertained. In ascertaining the construction, regard must be had to the legal relation and condition of the parties, and their rights and liabilities when they entered into the contract. The appellants were the owners of a parcel of land, which, though designated -as separate or distinct lots in the plan of the city, and by the designation were capable of distinct conveyance, and of separate ownership, yet in fact adjoined, and were used and occupied as an entirety; as forming and constituting, in the language of the bill, one compact settlement, the residence of one of the appellants. The talcing of a part of the lots for the uses of the railroad, was the talcing of private property for public uses, and, under the constitution, in the absence of ■ a contract or agreement with the owner, could be legalized only by the payment to them of just compensation at the time of. the talcing. Just compensation included not only the value of the parts of .the lots actually taken and appropriated to the use of the company, but the injury to-the remaining lots or parts of lots, and if the ways of ingress to, and egress from the lots were obstructed or interrupted, such obstruction or interruption formed a part of the injury, for which compensation should have been made. The general rule of damages in such cases is the fair market value óf the land actually taken, and the diminution in the market value of the land not taken, because of the uses to which the part taken is appropriated. In other words, the difference between the market value of the whole lots as -they were at the time of the taking, and the market value of the lots and parts- of lots re- ' maining to' the appellants after such taking, was the measure of just-compensation tó which they-were entitled.-^-Pierce on Rail- ' roads, 210’; Cooley Con. Lim. 708, (4th Ed.) It is apparent that the contract was entered into in view of the relation of the parties, and of their rights, and liabilities in that relation— a -land-owner whose property was, to be taken for public use,, and a corporation having authority'for such uses to take and acquire it. The payment to the appellants of the compensation ' they were entitled to receive, partly in money, and partly by the ¡performance and-maintenance of-the work on the streets, where intersected by the railroad, obstructing access to the lots, impairing their value, was the purpose the parties had in view. Time was given the company, a period of nearly nine months, for the performance of the work, and in the event it was in ,de*535fault at the expiration of the period, it stipulated to pay the appellants one dollar for each day the default continued.
It is certainly competent for parties entering into a contract, to avoid all future contention as to the’amount of damages which may result from its breach, to agree and fix upon a certain, definite sum, as that which shall be paid to the party injured by the party in default in performance of the contract. Damages so ascertained are termed indifferently liquidated,-or stated, or stipulated damages. Though the parties may agree, and may express precisely their agreement, declaring the sum to be paid in event the contract is broken, and denominate it as fixed, or stated, or liquidated damages, a perplexing question often arises, whether the intention was - to afford fair and reasonable compensation for the injury- resulting from the-breach, simply and merely, or whether, by way of quickening diligence in punctual performance, a penalty or a forfeiture-was intended, which must be suffered without regard to the actual injury resulting from the failure to keep the contract.. In the determination of this question, as in the determination of all other questions touching the construction of contracts, the governing guides are the subject of the contract, and the intention of the parties. - Considering this particular question, said Chief Justice Collier, in Watts v. Sheppard, 2 Ala. 434,. “ the first general principle in the construction of all contracts, is, that they shall be so expounded, as to carry into effect the intention of the parties. To this end, the court should, if necessary, look to the subject-matter of the contract, the situation of the parties, the motives, that led to it, and the objects intended to be attained by it.” Among principles well established in determining whether a stipulation or covenant of the character now under consideration is in its nature a penalty or liquidated damages, the first is, that it is the tendency and preference of the law, to regard the stipulation or covenant as of the nature of a penalty, rather than as liquidated damages, because then it may be apportioned to the loss actually sustained; and compensation for that loss is the full measure of justice and right. — Shute v. Taylor, 5 Metc. 61; Fisk v. Gray, 11 Allen, 132; Wallis v. Carpenter, 13 Allen, 19; Bagley v. Peddie, 5 Sandf. (Sup. Ct.) 192; Baird v. Tolliver, 6 Humph. 186. And if it be doubtful, upon a just consideration . of all the terms and purposes of the contract, of the relation of the parties, of their objects and purposes, and of the duty to be performed, whether the sum stated was intended as liquidated damages, or as a penalty, as’ the latter it will be construed. Shadduck v. Marsh, 1 Zab. (N. J. Law), 434; Whitfield v. Levy, 6 Vroom (N. J. Law), 149; Tayloe v. Sandiford, 7 Wheat. 13; Bagley v. Peddie, supra. And where the agree*536ment or covenant is for the performance of several things, and the stipulation is for the payment of a sum in gross in the event of a failure to perform, in whole or in part, the sum stated will be considered as a penalty.— Watts v. Sheppard, 2 Ala. 425; Bagley v. Peddie, supra; Shadduck v. Marsh, supra; Owens v. Hodges, 1 McMullen (Law), 106; Basye v. Ambrose, 28 Mo. 39; Curry v. Larer, 7 Penn. St. 470.
This stipulation is for work to be done at the intersection by the 'railroad' of four several streets, leading to or around the lots of appellants. The object in view was repairing the in jury done to the lots by the obstruction or interruption of access to and from them, through and by these streets; in this respect, to place the lots as far as practicable in the condition they were • when the railroad was constructed. It is scarcely possible that the work to be done on the crossings of each street, involved the same labor and expense, or that the injury resulting to the appellants from the obstruction or interruption of each crossing, was the same in degree; yet, the stipulation is for the payment of the same sum for each day’s default in the performance of any part of the work, as for a default in entire performance. Any breach of the stipulation, great or small, without regard to the consequent injury to the appellants, makes a default for which the amount to be paid is precisely that which must be paid for an entire non-performance. This is manifestly unreasonable, aird it is not improbable may be unconscionable to either party — in one event, exceeding the actual injury the appellants may sustain, and in another, not equaling, but falling below it. ."When the whole contract is considered, the relation of the parties, and the objects, it is apparent, they had in view, it •seems plain enough that the parties could not have intended that the sum mentioned should be taken as liquidated damages. It is, to say the least, doubtful what was tlieir intention, and ■there is less danger of oppression and injustice from regarding it as a penalty than from treating it as a covenant to pay liquidated damages.
The diminution of the value of the lots of the appellants because of the obstruction or interruption of the public ways •or streets leading to them, is, as we have seen, an element of the just compensation which must be made to them, because of the taking.and appropriation of parts of the lots#to the uses of the railroad company. This diminution of value is the real loss sustained, the injury the stipulation of the contract was intended to repair, and for the loss and injury the appellants are entitled to a recovery. As a general proposition courts of equity do not entertain suits, the sole object of which is compensation for breaches of contracts, or the recovery of damages for wrongs cognizable at law, because in courts of law, for such *537grievances, there are plain, complete, and adequate remedies. But when the court has jurisdiction, as incidental to other relief, or if a peculiar equity intervenes, compensation or damages may be decreed. — 2 Story’s Eq. § 794. If the parties had not agreed —if the company had not entered upon and acquired possession of the lands taken, with the consent of the appellants, without the prepayment of the damages resulting from the obstruction of access to the lots, and all other damages forming the just compensation which must be made, before private property can be taken and appropriated to public uses, a court of equity would have intervened and restrained by injunction the entry upon and possession of the land by the company.- — Bonaparte v. Camden and Amboy R. R. Co., 1 Baldwin, 205; Jersey City & Bergen R. R. Co. v. Jersey City & Hoboken R. R. Co., 20 N. J. Eq. 61; Stacy v. Vermont Central R. R. Co., 39 Vt. 14. Entering upon the lands, acquiring possession by contract with the appellants, the relation of the parties is that of seller and purchaser. If the company had stipulated to pay, and the appellants had agreed to accept a specific sum of money, as just compensation for the lands taken, that sum would, of necessity, have embraced all compensation the appellants could have claimed for the interruption or obstruction of the highways leading to and from these lots; or because of the diminished value of the lots from any cause, in the appropriation of parts of them to the uses of the qpmpany. That sum would have been as essentially the purchase-money of lands, or of a right and interest in and to lands, as when between natural persons, there is a bargain and sale for a specified price. What difference is there in right and principle, wdien a specific sum is promised and paid as partial compensation, and there is a promise to repair an injury by work and labor, which lessened the value of the remaining lands of the owner, for which he is entitled to compensation ? If the injury is not repaired, the owner suffers loss, and the company gets the land without making the compensation justly due, without paying the consideration upon which it was let into' possession. The real foundation of the lien of a vendor for the purchase-money of lands, is that it is against good conscience for one man to get and keep the lands of another, without paying the consideration promised to be paid for them. For the performance of the contract by ’the company, in all its parts, it is evident the appellants relied, and the company intended they should rely, on the lands taken as a security. Tlie retention of the legal title is .very strong, if it is not conclusive evidence of this reliance. The terms of the contract are conclusive — it is only in ret/urn for the performance by the company of the contract, that the appellants promise to give the company “ the right to mm their road *538through said Block, on the road-bed, as at present graded, and to the use of all of lot number foior, on the north side of said railroad tract, and the right of wa/y on lot number four to the extent of twenty-five feet from the eentn-e of said railroad tract.” The vendor of .lands who conveys the legal title, not taking some other security than the promise of the vendee to pay,, retains a lien for the purchase-money, and the presumption that it is retained, must be repelled by clear and convincing evidence of an agreement or intention to the contrary. The vendor who retains the legal title, and stipulates to convey it only on full payment of the purchase-money, holds it as a security for the purchase-money, which is of equal dignity with a mortgage. - Courts of equity often intervene to compel railroad corporations to the specific performance of contracts they make with land-owners. — 2 Story’s Equity, § 1566. In Cosens v. Bognor Railway Co., Law Rep., 1 Ch. App. 594 (cited, 1 Redf. on Railways, 5th Ed. 256), a court of equity enforced the payment of damages assessed to the land-owner against a railway company, entering and constructing its road without making payment of them, by injunction restraining the use of the land until payment was made. In Walker v. Ware, Hadham & Buntingford R. R. Co., 1 Law Rep , Eq. Cases, 195, under an assessment of compensation, and by agreement with the land-owner, the railroad company entered into possession, promising payment of the compensation assessed, „and to pay such damages as a particular individual should award the owner for the injury he sustained by reason of the severance of the lands, .or because of injury to his remaining lands. The Master of the Rolls, Sir. J~. Romillv, held, that the land-owner had a lien not only for the purchase-money of the lands which had been assessed as compensation, but for the damages resulting from the severance of the lands, and the injury to his remaining lands; and' that, although the road had been constructed and opened for public uses, the lien would be enforced by a sale of the land-
There are authorities in this country recognizing the existence of a lien akin to that' of a vendor’s lien, in favor of the landowner letting a railroad company, into possession, upon conditions it fails or refuses to perform. Many of them are collated and referred to in Pierce on Railroads, 169, n. 5. In Dayton R. R. Co. v. Lewton, 20 Ohio St. 401, the land-owner agreed “-to release the right of way, and the right to'enter up-' on and construct its railroad ” through his lands. In consideration thereof the company agreed to pay a certain sum of money at a future day, and to construct certain road-crossings and cattle-guards. Without receiving a deed to the right of way or any conveyance of it, before paying the money, and before constructing the crossings or guards, the company entered into *539possession and constructed its road. The court were of opinion the land-owner’ was entitled, at his election, to a specific performance of the contract, or to enforce a ljpn upon the lands, not only for the unpaid purchase-money, but also for the-damages resulting from the failure to construct the road-crossings and the cattle-guards.
The only claim of the railroad company. to the lands taken from the appellants, and - appropriated to its uses, is derived from the contract, into which the parties entered. That contract did not pass a legal title; on the contrary, the legal title-was retained by the appellants as a security for the performance by the company of the stipulations it agreed to perform, as-the consideration for the lands. Its title was, at most, merely equitable, and its mortgagees can not be regarded asbonafide purchasers for a valuable consideration, without notice. To the equitable right or title of the company these mortgagees-succeeded, and they take it cum onere. They are chargeable with notice of the nature and character of the fight and title; and possession of the railroad company.— Gillison v. S. & C. R. R. Co., 7 S. C. (Law), 173.
Whether the appellants shall ¡Droceed to enforce specific performance of the contract, claiming compensation for any damages suffered from-the failure of the company to do the work stipulated-; of' shall seek to enforce a lien for the diminished value of the lots because of the obstruction or interruption of access to them, there must be an amendment of the-bill. Whether the right to specific performance has been lost- or not, by the delay in claiming it, is a question which must be-left' open for consideration, if the bill is so amended as to claim it.' In the present aspect of the case, it is enough to say, the-bill is not devoid of equity, though its gravamen may be defectively stated; and' the motion to .dismiss should not have-been allowed.
The decree of the chancellor must be reversed, the motion to dismiss the bill for want of equity overruled, and the cause; remanded. •