The plaintiffs, the MacCurdy-Salisbury Educational Fund, hereinafter referred to as the Educational Fund, and the Old Lyme-Phoebe Griffin Noyes-Library Association, Inc., hereinafter referred to as the Library, have brought this action asking that the Superior Court empower the plaintiffs to make annual distributions of income and principal bequeathed to them under the will and codicil of Evelyn MacCurdy-Salisbury, which distributions it is claimed are necessary to avoid liability for taxes which may be imposed under § 4942 of the Internal Revenue Code of 1954. In addition, the plaintiffs request that the judgment of this court have the same force and effect as if set forth expressly in the provisions of the last will and codicil of Evelyn MacCurdy-Salisbury. The bequests in question were made pursuant to the will of Evelyn MacCurdy-Salisbury, who died on December 31, 1917, and whose will was admitted to probate January 11, 1918. *Page 205 
Under article third of the will, the plaintiff Educational Fund received the sum of $12,500 to set up a permanent special fund. Article third also provided, inter alia, that "one-third of the annual income of said Fund shall be added to the principal for ninety-nine years, or so long as the law allows." Under article fifteenth of the will, the plaintiff Library received the sum of $5000 subject to the same restriction. Other provisions of the will left a substantial sum to the plaintiffs subject to the same restriction.
Acting under the instructions in the will, the plaintiffs have regularly taken one-third of the income of the bequests and added it to the principal, using only the remainder of the income for their support. At the present time the principal amount administered by the Educational Fund is approximately $1,130,000, and the principal administered by the Library is $653,175.
As a result of amendments to the Internal Revenue Code generally referred to as the Tax Reform Act of 1969; 83 Stat. 487, 502; the plaintiffs are liable for substantial tax liabilities on the portions of the undistributed income. Section 4942 of the Internal Revenue Code provides in part: "(a) Initial tax. — There is hereby imposed on the undistributed income of a private foundation for any taxable year, which has not been distributed before the first day of the second (or any succeeding) taxable year following such taxable year (if such first day falls within the taxable period), a tax equal to 15 percent of the amount of such income remaining undistributed at the beginning of such second (or succeeding) taxable year. The tax imposed by this subsection shall not apply to the undistributed income of a private foundation — (1) for any taxable year for which it is an operating foundation (as defined in subsection *Page 206 
(j)(3)), or (2) to the extent that the foundation failed to distribute any amount solely because of an incorrect valuation of assets under subsection (e), if — (A) the failure to value the assets properly was not willful and was due to reasonable cause, (B) such amount is distributed as qualifying distributions (within the meaning of subsection (g)) by the foundation during the allowable distribution period (as defined in subsection (j)(4)), (C) the foundation notifies the Secretary or his delegate that such amount has been distributed (within the meaning of subparagraph (B)) to correct such failure, and (D) such distribution is treated under subsection (h)(2) as made out of the undistributed income for the taxable year for which a tax would (except for this paragraph) have been imposed under this subsection. (b) Additional tax. — In any case in which an initial tax is imposed under subsection (a) on the undistributed income of a private foundation for any taxable year, if any portion of such income remains undistributed at the close of the correction period, there is hereby imposed a tax equal to 100 percent of the amount remaining undistributed at such time."1
Each plaintiff has received notice from the internal revenue service that a determination has been made that it is a private foundation within the meaning of §§ 501(c)(3) and 509(a) of the Internal Revenue Code. Section 501(c)(3) defines a "private foundation" as follows: "Corporations, and any community chest, fund, or foundation, organized and operated exclusively for religious, charitable, scientific, testing for public safety, literary, or educational purposes, or for the prevention of cruelty *Page 207 
to children or animals, no part of the net earnings of which inures to the benefit of any private shareholder or individual, no substantial part of the activities of which is carrying on propaganda, or otherwise attempting, to influence legislation, and which does not participate in, or intervene in (including the publishing or distributing of statements), any political campaign on behalf of any candidate for public office."
It is conceivable that the plaintiffs could be exempt from taxation under §§ 4942(a) and (b) if each qualified as an "operating foundation." An "operating foundation" under § 4942(j)(3) "means any organization — (A) which makes qualifying distributions (within the meaning of paragraph (1) or (2) of subsection (g)) directly for the active conduct of the activities constituting the purpose or function for which it is organized and operated equal to substantially all of its adjusted net income (as defined in subsection (f)); and (B)(i) substantially more than half of the assets of which are devoted directly to such activities or to functionally related businesses (as defined in paragraph (5)), or to both, or are stock of a corporation which is controlled by the foundation and substantially all of the assets of which are so devoted, (ii) which normally makes qualifying distributions (within the meaning of paragraph (1) or (2) of subsection (g)) directly for the active conduct of the activities constituting the purpose or function for which it is organized and operated in an amount not less than two-thirds of its minimum investment return (as defined in subsection (e)), or (iii) substantially all of the support (other than gross investment income as defined in section 509(e)) of which is normally received from the general public and from 5 or more exempt organizations which are not described in section 4946(a)(1)(H) with respect to each other or the recipient foundation; *Page 208 
not more than 25 percent of the support (other than gross investment income) of which is normally received from any one such exempt organization; and not more than half of the support of, which is normally received from gross investment income."
It is clear under the terms of §§ 4942(a) and (b) that in the event income remains undistributed through a "correction period," such income will be essentially confiscated. As "private foundations," the plaintiffs must comply with the income distribution requirements of § 4942 or suffer near total depletion of their undistributed income. The conflict between the tax provision and the will provision relating to reinvestment of income is manifest.
The central issue presented here is whether the court can permit the distribution of income contrary to the reinvestment requirements of the testatrix. It is obvious that the testatrix, by the reinvestment requirements, had in mind an accumulation of funds to maximize the benefits to objects of her bounty. That purpose, however, can no longer be effectuated by accumulating the income because the tax on the accumulated income is essentially confiscatory. Under the Tax Reform Act of 1969, the plaintiffs must distribute their entire income or fill the federal coffers with the undistributed portion.
Under the circumstances, a modification of the will requirement to conform to the requirement of §§ 4942(a) and (b) of the Internal Revenue Code appears warranted by the doctrine of deviation. The courts will generally permit deviation from the terms of a trust where compliance is illegal or impossible, or where, owing to circumstances not known to the settlor, literal compliance would defeat or substantially impair the accomplishment of the purposes of the trust. See Bristol Baptist Church v.Connecticut Baptist Convention, 98 Conn. 677, 681; *Page 209 Connecticut Bank  Trust Co. v. Johnson MemorialHospital, 30 Conn. Super. Ct. 1; 4 Scott, Trusts (3d Ed.) § 381. Here the dominant purpose of the creation of the funds would be defeated by attempting to accumulate the income. In addition, it is highly significant that the testatrix, in setting up the funds, clearly stated that the income should be added to the principal for "ninety-nine years, or so long as the law allows." The condition of accumulation can no longer be advanced under the terms of the will, and her intention is clear that the conditions of the will may be changed to conform to existing circumstances, effectuating the paramount purpose of her bequests.
The application of the doctrine of deviation is particularly warranted where, as here, the fund may continue to be used for a long time and unforeseen circumstances may arise. Estate of Loring,29 Cal. 2d 423, 436. There is no need to resort to the doctrine of cy pres to permit this, as the change is warranted under the court's administrative powers over administration of trusts. Charlotte HungerfordHospital v. Mulvey, 26 Conn. Super. Ct. 394, 397; SouthKingstown v. Wakefield Trust Co., 48 R.I. 27, 32. The courts in New York were faced with a similar situation in Matter of Roche, 69 Misc. 2d 481. There the testator had provided that the principal of the trust "shall always remain vested in my said trustees"; however, the court permitted distribution of principal in order to meet the distribution requirement of § 4942 of the Internal Revenue Code. That decision clearly preserved the use of the bequest for charitable purposes rather than allowing it to line the pockets of the tax collector.
It is true that the bequests are not held by the plaintiffs in trust; Lyme High School Assn. v.Alling, 113 Conn. 200, 204; however, charitable corporations are generally subject to the same restrictions *Page 210 
as charitable trusts; 4 Scott, Trusts (3d Ed.) § 348.1, p. 2778; and the doctrines of deviation and cy pres are equally applicable to charitable corporations. See Smith v. Livermore, 298 Mass. 223, 236;Matter of Scott, 1 Misc. 2d 206 (N.Y.).
It is noteworthy that the General Assembly in 1971 enacted legislation dealing with the situation with which we here are confronted. General Statutes § 33-281c (a)(2) provides that in the administration of any trust which is a private foundation or a charitable trust, "during the period while it is such a foundation or trust, amounts shall be distributed for the purposes specified in the trust instrument, in such manner and at such times as are at least sufficient to avoid liability for the tax imposed by section 4942" of the Internal Revenue Code of 1954. Jurisdiction over the administration of charitable trusts rests entirely in the judicial department.Bridgeport Public Library  Reading Room v. BurroughsHome, 85 Conn. 309, 320. Jurisdiction to ensure the proper and beneficial administration of charitable trusts under changing conditions rests with the judiciary. Second Ecclesiastical Society v.Attorney General, 133 Conn. 89, 92. This court, rather than the legislature, clearly has the power to order the deviation from the strict terms of the testatrix' will. Hartford v. Larrabee Fund Assn.,161 Conn. 312, 318.
   Accordingly, it is ordered that the plaintiffs shall annually make distribution of any such amounts of income and principal bequeathed to them under the will and codicil of Evelyn MacCurdy-Salisbury as may be necessary to avoid liability for the tax imposed by § 4942 of the Internal Revenue Code in 1954 and that the provisions of this judgment shall have the same force and effect as if set forth expressly among the provisions of the last will and codicil of Evelyn MacCurdy-Salisbury.