
256 N.W.2d 225 (1977)
Dorothy SIMMONS, Executor of the Estate of Lester Morgan Wells, Deceased, Appellee,
v.
PARSONS COLLEGE et al., Defendants, and
Drake University, Appellant.
No. 2-59053.
Supreme Court of Iowa.
July 29, 1977.
*226 Ahlers, Cooney, Dorweiler, Haynie & Smith, Des Moines, for appellant.
Kelly & Morrissey, Fairfield, and R. A. Sloan, Jr., Iowa City, for appellee.
Heard before MOORE, C. J., and MASON, LeGRAND, REES and UHLENHOPP, JJ.
LeGRAND, Justice.
This declaratory judgment action was brought to construe the will of Lester Morgan Wells as it relates to two trusts established for the education of needy students at Drake University and Parsons College.
The will was executed on August 15, 1969. Lester Morgan Wells died on January 3, 1974. After the execution of the will but prior to the testator's death, Parsons College became bankrupt. It no longer operates as an educational institution.
The action was brought by Dorothy Simmons, Executor of the estate of Lester Morgan Wells. Parsons College (and its trustee in bankruptcy), Drake University, and the heirs at law of the decedent were made defendants. The trial court held the trust established for Parsons College students failed and the testator's heirs at law were entitled to take the property which would otherwise have gone to Parsons College as trustee.
Parsons College has filed a disclaimer and is not a party to this appeal. The heirs at law, of course, do not appeal. The sole appellant is Drake University (Drake), and our discussion is limited accordingly. We affirm the trial court.
We set out the controversial provision of decedent's will:
"Fourth: All the rest of my estate and the assets thereof, I give, devise and bequeath, subject to the provisions of the Fifth Paragraph of this will, to Drake University of Des Moines, Iowa, and Parsons College of Fairfield, Iowa, in equal shares, for SCHOLARSHIP PURPOSES ONLY. Such funds shall be held in a permanent trust by each institution, which shall be known as the LESTER MORGAN WELLS TRUST, and only the income therefrom shall be used to assist needy students to receive a college education and the same shall be paid to such persons and in such amounts as the respective colleges shall determine, but the principal is to be kept intact and properly invested as a permanent trust fund; said institutions are not required to give bond. "It is my wish and desire, but not mandatory, that the trust fund herein established and devised for Parsons College of Fairfield, Iowa, be used for the benefit of students seeking a college education who reside in Jefferson County, Iowa, or in the vicinity thereof, which shall include the State of Iowa but not beyond.
"If either or both of said institutions should fail to faithfully carry out the provisions of the Fourth Paragraph of this will, then said trust or trusts shall fail and shall stand cancelled and revoked and the principal thereof I will, devise and bequeath to my legal heirs at law who may be living at that time and as may be determined by the laws of the State of Iowa, said heirs to be determined as of the date of my death."
Several codicils were executed later, but they are unimportant to the issues raised on this appeal.
*227 Although Drake poses a number of questions to be answered, the sole issue presented is whether the doctrine of cy pres should be applied to the Parsons College trust in view of that institution's inability to carry out the trust purposes. Drake says we should apply cy pres and urges us to let it serve as trustee for the entire fund. Otherwise, Drake argues, that portion of the funds left to Parsons College will revert to numerous collateral heirs whom the testator did not know and whom he did not intend to benefit.
Cy pres is a doctrine which literally means "as near as may be." Hodge v. Wellman, 191 Iowa 877, 882, 179 N.W. 534, 536 (1920); 9 Drake L.Rev. 90, 94 (1959). It is applicable only to charitable trusts and then only when the trust established by a testator fails, no alternative disposition of the property has been made, and the general trust purposes may be accomplished by permitting it to be administered in a way different from, but closely related to, the testator's plan.
The doctrine is stated this way in Restatement (Second) Trusts, § 399 (1959):
"Failure of Particular Purpose Where Settlor Had General Charitable Intention. The Doctrine of Cy Pres.

"If property is given in trust to be applied to a particular charitable purpose, and it is or becomes impossible or impracticable or illegal to carry out the particular purpose, and if the settlor manifested a more general intention to devote the property to charitable purposes, the trust will not fail but the court will direct the application of the property to some charitable purpose which falls within the general charitable intention of the settlor."
While charitable trusts are favored by the law (In Re Estate of Small, 244 Iowa 1209, 1225-1227, 58 N.W.2d 477, 485 (1953)), courts may not ignore the testator's intent in order to give effect to doubtful trust provisions by invoking the doctrine of cy pres. Cy pres is simply a liberal rule of construction used to carry out, not defeat, the testator's intent. In Re Estate of Staab, 173 N.W.2d 866, 870 (Iowa 1970); Hodge v. Wellman, supra, 191 Iowa at 882, 179 N.W. at 536.
The cy pres doctrine is inapplicable when the testator has anticipated the possible failure of the trust and has made alternative disposition of his property to meet that contingency. Under such circumstances the testamentary intent may be ascertained without such extrinsic help. 15 Am.Jur.2d Charities § 160 (1976); 14 C.J.S. Charities § 52c. (1939); Mary Franklin Home v. Edson, 193 Iowa 567, 572, 574, 187 N.W. 546, 549 (1922); In Re Estate of Berry, 29 Wis.2d 506, 139 N.W.2d 72, 77-78 (1966); Jewish Guild for Blind v. First Nat'l Bank, 226 So.2d 414, 416 (Fla.App.1969); Application of Syracuse University, 3 N.Y.2d 665, 171 N.Y.S.2d 545, 548-549, 148 N.E.2d 671, 673-674 (1958); Board of Trustees v. Cheney, 158 Neb. 292, 63 N.W.2d 177, 183 (1954); Pennsylvania Co. for Banking & Trusts v. Board of Governors, 79 R.I. 74, 83 A.2d 881, 888 (1951).
Although Drake argues otherwise, the testator made such alternative disposition in the event either Parsons or Drake was unable to administer the trust. He said unequivocally the assets which would have gone to the trust should then go to his heirs at law.
This was the basis for the trial court's ruling that the cy pres doctrine was not applicable. We hold this conclusion was correct. We have reviewed all of the authorities relied on by Drake. None of them afford substantial support for its position.
We are told the case is stronger in favor of cy pres because the trust failed at the outset rather than after it had been under administration for some time. The authorities are to the contrary. The doctrine is more reluctantly resorted to under such circumstances. See Restatement (Second) Trusts § 399, Comment "i", at 302 and 14 C.J.S. Charities § 52c. at 516.
We hold the bequest to Parsons College in trust for the purposes set out in the Fourth Paragraph of decedent's will has failed because Parsons College is unable to *228 administer the trust. We further find that the last will of Lester Morgan Wells provides the designated trust property under such circumstances should go to his heirs at law.
The judgment of the trial court is affirmed.
AFFIRMED.
