
130 Ill. App.2d 514 (1970)
264 N.E.2d 287
In re ESTATE OF HARRY L. BROWN, Deceased, Appellee.  (PETITION OF HARBRO, INC., and CAREY GRAIN CORPORATION, Petitioners-Appellants.)
No. 69-172.
Illinois Appellate Court  Second District.
October 27, 1970.
Rehearing denied December 3, 1970.
*515 Benjamin J. Schultz, of Chicago, Hall, Meyer, Fisher, Holmberg, Snook & May, of Waukegan, for appellants.
Gottlieb & Schwartz, of Chicago, (Charles D. Stein, and Mark S. Lieberman, of counsel,) for appellee.
Reversed and remanded.
Mr. JUSTICE SEIDENFELD delivered the opinion of the court:
This appeal is from a decree wherein the bench denied a petition filed in the probate proceedings for specific performance and general relief against the executors based upon an agreement by decedent to sell his shares in petitioner companies in event of his death. For the reasons set forth herein, we are of the opinion that the court below was in error and that the petition should have been granted so as to effectuate the declared intention of the parties to the agreement.
In 1957 the decedent was the sole owner of two Illinois corporations, Harbro, Inc. and Carey Grain Corporation, having paid $89,000 for all of the corporate shares. For convenience of reference, these corporations will herein be called "Harbro" and "Carey", and will be collectively *516 referred to as "the Companies". In August, 1959, Irwin Cole and his sister, Sylvia Floun Schwartz (both herein called "Cole") purchased 50% of the decedent's interest in each of the Companies for the price of $94,500, with the decedent retaining a 50% interest therein. As a result of that transaction, decedent received more money than he had theretofore invested in the Companies, which at that time had a deficit of approximately $90,000.
Simultaneously with the stock sale, two agreements were entered into. One of these was an agreement by which the decedent and Cole agreed to vote the shares of the Companies to elect four members to the boards of directors of each, two to be designated by decedent "or his personal representative" and two to be designated by Cole "or his personal representative". The other agreement was entitled "Stock Purchase Agreement" (described in greater detail below). The Stock Purchase Agreement, which is very comprehensive, was prepared by decedent's attorneys. The respective boards of directors of the Companies authorized the execution of the Stock Purchase Agreement, and further amended the respective by-laws to provide that the vote of three directors was required for corporate action.
Section 7 of the Stock Purchase Agreement is entitled "Options on Death of a Stockholder," and provides in part as follows:
"Upon the death of either Cole or Brown (hereinafter in this Agreement sometimes called the `First Deceased Stockholder'), the Companies or their designees shall, for ninety (90) days from and after the date of his death, have the right and option to purchase all of his Stock from his estate. * * * If such option shall be exercised as aforesaid, the First Deceased Stockholder's estate shall, within thirty (30) days after receipt of the aforesaid notice, sell all of said Stock to the purchaser at the price and in the manner hereinafter set forth. * * *
(a) The price to be paid for the Stock shall be the greater of
(i) the book value thereof (as determined under the provisions of Section 11) as of the date of death of the First Deceased Stockholder; or
(ii) an amount set forth in a certificate of agreed value to be executed periodically by Brown and Cole and filed with the Companies."[1]
*517 Section 9 of the Stock Purchase Agreement provided that the shareholders "and the Companies hereby agree to take all other action, required or advisable to effectuate the terms and provisions of this agreement."
Section 11(a) of the Stock Purchase Agreement directs that book value shall be "determined by the regularly employed auditors of the Companies on the basis of standard accounting principles applicable to the business of the Companies". This section directs that "the book value of the Stock as determined by the auditors, shall be binding and conclusive on all persons".
Decedent died December 20, 1968. One of the executors of his estate is Stanley A. Kaplan, a partner of the law firm retained by decedent to prepare the Stock Purchase Agreement. On February 6, 1969, the day decedent's will was admitted to probate and the executors were appointed, the Companies served notice on the executors of their exercise of the option to purchase decedent's shares, pay the book value thereof, and comply with all the remaining provisions of the Stock Purchase Agreement. The Companies offered to pay the executors $22,586 on the basis, as the evidence later showed, that Harbro had a book value of $60,621, while Carey had a negative book value of $15,449, and that the executors were entitled to receive 50% of the combined net book value of the Companies. The executors refused to accept this offer, and the Companies filed a petition seeking an order directing the executors to comply with the terms and conditions of the Stock Purchase Agreement. Cole and Schwartz were added as additional parties to the proceeding.
At the conclusion of the hearing the trial court denied the Companies' petition for the following reasons: (1) the Companies' exercise of the option over the signature of Mr. Cole, its Vice-President and Acting President, was of no effect since it was not properly authorized or ratified by the boards of directors; (2) the amount which the Companies should have offered was $30,310.50, and not $22,586, since the book value of Carey cannot be less than zero; (3) since there is a great disparity between the book and market value of the Companies' shares, a court of equity should not in good conscience grant specific performance; and (4) Section 6 of the Illinois Business Corporation Act prohibits a corporation from purchasing its own shares except out of earned surplus, which did not exist in the case of the Companies.
The Companies thereupon perfected this appeal. We consider the judgment below under appropriate headings:

The Companies' Option was Properly Exercised.
After decedent's death the Companies each had only three directors, *518 and one of these, Mr. Kaplan, was an executor of decedent's estate. The remaining two directors, active at a meeting not attended by Mr. Kaplan, approved the Companies' exercise of the option. The executors contend that this was ineffectual since the by-laws were amended (on the same date of the Stock Purchase Agreement) to provide that the vote of three directors was necessary for corporate action. We disagree with this contention.
By the very nature of the option provisions of the Stock Purchase Agreement, the option could never be exercised if the renewed approval of three directors were necessary. The option, which runs in favor of the Companies, was obviously intended for their benefit; the Companies would exercise it only where the decedent's stock was worth more than its book value or the value periodically certified to by the parties. If the affirmative action of three directors were required, the option would be a nullity since one of the directors would be deceased and another would be his representative on the board. Naturally, the latter would not vote to have the decedent's shares sold for less than their true value (indeed, Mr. Kaplan refused to so vote in the instant case). This would leave only two directors who could conceivably desire to see the Companies exercise their option in any case where it would be advantageous for the Companies to do so.
 1 When the by-laws were amended to require the vote of three directors for general corporate action, at the same time that the directors specifically authorized the Stock Purchase Agreement, which contained the option, the parties necessarily contemplated that an additional vote of the directors would be unnecessary to exercise the option.
In any event, the purpose of the by-law amendment was to require that the majority of the board agree on a question before corporate action could be taken. After the vacancy created by decedent's death, the two directors who voted to approve the exercise of the option constituted a majority of the board.

It is no Defense that the Option Price of the Shares is Less than their Fair Market Value.
The court below determined that because of the disparity between the option price and the fair market value of the shares, enforcement of the option terms would be "clearly inequitable and oppressive". Specific performance was accordingly denied, although the court did not hold the contract to be void.
 2 To be sure, a court of equity may refuse to grant specific performance of "unconscionable, oppressive, or iniquitous contracts" (Palmer v. Chamberlain (5 CA-1951), 191 F.2d 532, 540), or where the evidence *519 "shows circumstances which appeal to the good conscience of the chancellor". (Neuberg v. Clute (1955), 6 Ill.2d 58, 64.) We do not question the rationale of these decisions; we simply point out that the criteria therein recited for denying specific performance do not exist where the only charge of inequity is based upon a change in value or other circumstances.
 3 The Illinois courts have consistently held that where a contract has been fairly entered into in good faith, and without fraud, concealment or overreaching, it may be specifically enforced in spite of a subsequent change in circumstances. Thus, in In Re Estate of Frayser (1948), 401 Ill. 364, the trial court had specifically enforced an option in a lease for the sale of the real estate at a fixed price. The lessor's heirs appealed, and urged among other things, that the option was unfair and unreasonable because the property had greatly appreciated from the date of the lease to the date the option was exercised. The Supreme Court disposed of this defense, saying at Pages 371-72:
"The courts can have no concern with the wisdom or folly of a contract, made for a consideration and without fraud, where the parties are competent to contract and enter into same fairly and understandingly. Here the parties were sui juris and there is no charge of fraud or overreaching. The object of courts of equity, as well as courts of law, is the enforcement of contracts rather than their evasion, and where a valid contract exists for a sale of land a court of equity will enforce it as a matter of right where it was fairly and understandingly entered into and no circumstances of oppression and fraud appear. (Miedema v. Wormhoudt, 288 Ill. 537.) The mere fact the value of the property has increased or diminished since the contract was executed ordinarily will not warrant a refusal to carry out its terms, in the absence of circumstances indicating fraud or bad faith. Anderson v. Anderson, 251 Ill. 415."
 4 In Brubaker v. Hatjimanolis (1949), 404 Ill. 342, the defendant argued that to compel him to specifically perform a contract for the sale of real estate was highly inequitable because the land had materially increased in value during the five years since the contract was executed. The court made it clear that whether a contract was fair or works an unconscionable hardship is generally determined with reference to the time when made, adding at Page 348:
"The mere fact there has been a decrease or increase in the value of the involved property since the contract was made will not of itself warrant a refusal to compel specific performance, where circumstances indicating fraud or bad faith are absent." Citing authorities.
*520 In the instant case, there is no allegation or showing that the Stock Purchase Agreement was procured through fraud, unfairness or overreaching, or that it was somehow unfair at the time it was executed. To the contrary, the decedent had owned and operated the Companies for the two years prior to the agreement, and must be presumed to have been at least as familiar with their value as was Mr. Cole and his sister. When it was agreed that the survivor could purchase the share of the first to die on the basis of book value, Cole was perhaps more vulnerable than decedent. Decedent had by then recouped his investment in the Companies by selling 50% of his shares to Cole for $94,500. Had Cole died shortly after making this investment, when the Companies still had a $90,000 deficit, the Companies could have acquired his shares for nothing, notwithstanding that he previously would have paid $94,500 for the same shares.
Certainly the parties contemplated that the value of the Companies might change from time to time, and that book value could become an unrealistic yardstick. It was for that reason that they provided in their agreement that the book value test could be superseded if the parties subsequently agreed to use a different value. As the trial court specifically found, no such subsequent agreement was ever reached.
We here note that the amount actually offered the executors by the Companies was $22,586, but that in their petition they offered to pay such sum as required under the Stock Purchase Agreement. In arriving at this figure, the Companies subtracted Carey's negative book value of $15,449 from Harbro's book value of $60,621, and offered 50% of the difference since 50% of the outstanding shares were being purchased. The trial court ruled, for purposes of this computation, that Carey could not have a book value of less than zero, and that the proper option price (assuming the option was lawfully exercised) should have been $30,310.50. We believe this ruling was correct.

Section 6 of the Business Corporation Act does not Prevent the Companies' Exercise of the Option.
It is clear from the record in this case that neither of the Companies had earned surplus at the time they sought to exercise their option to purchase the decedent's shares. In reliance on Section 6 of The Illinois Business Corporation Act (Ill. Rev. Stat. 1967, ch. 32, par. 157.6), the trial court held that this lack of earned surplus prevented the Companies from repurchasing their own shares.
 5 It has long been the law of this State, even before the legislature spoke, that a corporation may not repurchase its shares or otherwise distribute its assets to its shareholders when by so doing its capital *521 structure would be impared to the detriment of its creditors or other shareholders. Olmstead v. Vance & Jones Co. (1902), 196 Ill. 236, 241-42; Fraser v. Ritchie (1881), 8 Ill. App. 554, 557-8; Commercial Nat. Bank v. Burch (1892), 141 Ill. 519, 528.
Under the common law, no clear cut test was formulated to determine when a repurchase of a corporation's own shares would violate the rights of creditors or minority shareholders. Therefore, in an effort to create guidelines for the protection of these interests from the actions of the majority shareholders, section 6 was enacted to provide that a corporation may not purchase its own shares when
"* * * its net assets are less than the sum of its stated capital, its paid-in surplus, any surplus arising from unrealized appreciation in value or revaluation of its assets and any surplus arising from surrender to the corporation of any of its shares, or when by so doing its net assets would be reduced below such sum."
Although neither this statutory language nor prior decisional law states in so many words that only corporate earnings can be used for the repurchase of shares, section 6 was construed in Precision Extrusions, Inc. v. Stewart (1962), 36 Ill. App.2d 30, as providing that a corporation may use only earned surplus for this purpose. In Precision Extrusions, the court said at page 41:
"The limitations set out in the statute were an attempt to spell out the corporation funds from which such purchase could be made. Section 6 in general provides that the purchase of a corporation's own shares may be made out of earned surplus, and in the notes on the section, in 1 Illinois Business Corporation Act Annotated, sec. 6, p. 51 (2d ed), it is said: `Because of the difficulty in framing an adequate definition of earned surplus, the rule was stated indirectly, forbidding purchases `out of' stated capital and various types of surplus other than earned surplus.' In a critical survey of the Illinois Business Corporation Act by Henry Winthrop Ballantime in 1 U of Chicago L Rev, p 365, it is stated: `The Illinois draftsmen, however, have avoided the use of the term `earned surplus' on account of the difficulty of framing any statutory definition of this accounting term, and have deemed it best to back into the concept by a process of elimination * * *."
 6 We have some doubt that the provisions of section 6 were intended to apply to circumstances under which no change in the assets of the corporation results from the purchase and creditors cannot suffer, but we note that since the Precision Extrusions decision, it has become accepted doctrine in Illinois that earned surplus is the only fund from which a corporation may repurchase its own shares (except where certain *522 statutory exceptions, not present here, might apply). See e.g., Cate v. Pagel-Clikeman Co., Inc. (1967), 87 Ill. App.2d 65; Alton Banking & Trust Co. v. Luer (1968), 101 Ill. App.2d 18; Overbeck and Teevan, Buy and Sell Agreements (1955), 43 Ill. Bar Journal 264, 268; Rule 10b-5 and Purchase by a Corporation of its own Shares (1966), 61 N.U.L.Rev. 307, 312.
 7 Inasmuch as neither of the Companies had earned surplus when they attempted to exercise the option, we must conclude on the basis of the foregoing that the Companies were not legally permitted to purchase the decedent's shares. We do not believe, however, that this lack of earned surplus affords the defendants in this case an absolute defense.
Here, the parties had entered into a Stock Purchase Agreement, section 9 of which provided as follows:
"The Stockholders hereby agree to vote their Stock in a manner, and they and the Companies hereby agree to take all other action, required or advisable to effectuate the terms and provisions of this agreement * * *."
Section 9 is significant for the reason that it declares that the parties agree to take all steps necessary to insure that the purpose of the agreement would be fulfilled.
 8, 9 As pointed out above, section 7 of the Stock Purchase Agreement specifically provided that the option to purchase a deceased shareholder's shares belongs to "the Companies or their designees." When the Companies sought to exercise their option, the rejection of the executors made no mention of the Companies' inability under section 6 of The Business Corporation Act. Had they done so, rather than raise this point for the first time as a defense to the petition below, it is entirely possible that the Companies would have named a third party as their "designee" under section 7. Thus, the agreement of the parties might lawfully have been carried out without the prolonged litigation that has ensued. Section 6 of The Business Corporation Act, in our opinion, would provide no defense to the executors upon a showing in the trial court, that the decedent's shares were being purchased by any third party designated by the Companies. Further, we believe that such a showing could still be timely made in the trial court upon a remandment of the cause. While the petition below did not specifically request such relief, we believe that the pleadings (which include a prayer for general equitable relief) essentially seek the aid of equity to enforce the Stock Purchase Agreement in all of its terms. The specific prayer for the purchase of the stock by the corporation may not be permitted but the evidence does authorize specific performance of the contract in a manner *523 not barred by statute and under conditions which are fair to the parties, recognizing their contractual commitments. Courts of Equity can and should shape remedies to achieve justice under particular facts and circumstances. Wolf v. Lawrence (1916), 276 Ill. 11, 21; Pope v. Speiser (1955), 7 Ill.2d 231, 242, 243; City of Aurora v. Y.M.C.A. (1956), 9 Ill.2d 286, 294, 295.
The cause is, therefore, reversed and remanded with instructions to permit amendments or further pleadings and additional proof, if necessary in the opinion of the trial court, to determine the issues in accordance with this opinion.
Reversed and remanded with directions.
DAVIS, P.J., and ABRAHAMSON, J. concur.

SUPPLEMENT TO OPINION UPON DENIAL OF PETITION FOR REHEARING
The executors have petitioned this court for a rehearing, urging that by our permitting enforcement of the parties' agreement upon a showing that the decedent's shares were being purchased by a designee of the Companies, we have advanced a theory not considered by the parties or by the trial court and, in fact, inconsistent with the theory advanced at trial. We are satisfied that the rationale of our opinion was not unfamiliar to the record, and had been considered in the opinion of the trial court as well as in all of the briefs submitted herein.
The contract in question was voluntarily entered into by parties who were totally familiar with its subject matter. By signing it, the decedent agreed that his shares could be purchased for a readily ascertainable price. His executors seek to side-step his agreement. Their reason is that the shares became more valuable than the contract price to which he had agreed, but their excuse is that Section 6 of the Business Corporation Act prohibits the Companies from purchasing these shares in the absence of earned surplus.
In determining whether their excuse for nonperformance is tenable, we observed: (1) the parties expressly agreed "to take all other action, required or advisable to effectuate the terms and provisions of this agreement"; (2) the contract permitted the Companies to designate any third party to purchase the shares; and (3) Mr. Cole and Mrs. Schwartz, the only other shareholders and the potential designess, were not only parties to the contract but, upon motion of the executors, were made parties herein. The Petition for Rehearing, therefore, is not persuasive in suggesting that our opinion requires the bringing in of new parties and a retrial of the case.
*524 The executors maintain that a formal designation should have been made shortly after the decedent's death, and the designee(s) could have exercised the option within the ninety day period. Yet the executors have argued throughout these proceedings that board action requires the vote of three directors and, as we note in our opinion, it would be naive to believe that the executors' representative on the board would vote to have someone purchase the decedent's shares for a price which they claim to be unconscionable.
We reject the executors' argument that we decided this appeal on a theory not advanced by the Companies and therefore not considered by the executors or by the trial court. In the written opinion of the trial court it was specifically noted that "the corporations in their brief [below] point out two ways * * * to circumvent the restrictions of Section 6. * * * The second is by having Cole and Schwartz furnish the money for the repurchase."
In the Companies' initial brief to this court, they state the following:
"No possible complaint could arise from a payment by Cole for the Brown shares and their surrender to the Companies. By the same token no wrong could occur if Cole used the Companies as his conduit through which to purchase the Brown shares. He could contribute the necessary monies and the transaction would have proceeded in an orderly manner."
The executors addressed themselves to this argument in their answering brief, noting that the petition for specific performance was filed by the Companies and not by Cole or any designee. (While this is so, we cannot ignore the plain fact that the executors themselves made Cole and Mrs. Schwartz additional parties below.)
Finally, in the Companies' reply brief we again find the argument that the effect of Section 6 could be avoided if Cole were made "the designee of the Companies" or if Cole personally paid the purchase price. Under the latter method, it was argued, the Companies would not be "purchasing" the shares, even if they thereafter "received" them as Section 6 expressly permits.
Without again passing on these arguments, which we carefully considered in the course of reaching our opinion, we have briefly restated them for the purpose of showing that we did not concoct a theory foreign to the record or to the briefs submitted by all of the parties.
The court in Pope v. Speiser, 7 Ill.2d 231, supra, at p. 243, even in the absence of a prayer for general relief (here present) noted the provisions of the Practice Act (Ill. Rev. Stat. 1967, ch. 110, pars. 33(3), 42(2)) providing for liberal construction of pleadings with a view to doing substantial *525 justice between the parties and approving pleadings which reasonably inform the opposite party of the claim which he is called upon to meet. On this record the adverse party was not prejudiced in the trial by reason of surprise in the presentation of evidence.
As we observed at the conclusion of our opinion, our disposition of this appeal is not only justified by the pleadings, the evidence and the prayer for relief, it is required in order to achieve what we regard to be the only just and equitable result.
Rehearing denied.
NOTES
[1]  The shareholders at no time certified to the agreed value of the Stock, as provided in Section 7(a) (ii). While there was evidence that the parties orally agreed that decedent would sell his stock to Cole for $100,000, the trial judge held that this did not constitute a de facto certificate of value, notwithstanding that a written agreement was being circulated for signature at the time of Brown's death. This holding, with which we agree, was not challenged in this appeal.
