OPINION
TODD, Presiding Judge, Middle Section.Third National Bank in Nashville, Trustee under the will of Nettie Turner Fite, deceased, filed this suit for instructions. From a summary judgment favoring the defendant, Dr. James S. Brown, Commissioner, the other defendants, Mullowney, Girtman and Fite, have appealed.
Dr. James S. Brown is Commissioner of the Tennessee Department of Mental Health and Mental Retardation, representing the interests of the State of Tennessee in the collection of a claim for care of a former inmate of an institution in his department.
Defendants, Mullowney, Girtman and Fite are the residuary beneficiaries of a trust created by the will of Nettie Turner *559Fite. Said will provided that the trustee (plaintiff) should
use any part of the income therefor (sic) which the Trustee deems proper for the support and maintenance of our daughter Jeanette Fite throughout her entire life.
Encroachment upon the corpus was also authorized “if the trustee deems it necessary”.
From 1975 to 1980, Jeanette Fite was a resident of a state institution. During this period the trustee received statements from the institution for the care of the resident, but the trustee did not pay the bills because of the objections of the three residuary beneficiaries. Jeanette Fite died on September 20, 1983. At that time, the accumulated charges for her care were $67,793.68, and the trust assets amounted to approximately $95,000. The residuary beneficiaries continued to object to the payment of the charges, and the trustee filed this suit for instructions.
The State reduced its claim to $57,435.27, and the Chancellor ordered the trustee to pay this amount. As stated, the residuary beneficiaries appealed.
Appellants’ issues are as follows:
1. Did the Trial Court err in not requiring the State to file a claim against the Estate of Jeanette Fite, Deceased?
2. Did the Trial Court err in failing to hold that the Trustee lacked discretion to allow the postmortem claim of the State, no judicial action having been taken by the State during the lifetime of Jeanette Fite, deceased?
3. Did the Trial Court err in failing to hold that the beneficial interest of Jeanette Fite under the will of her mother ceased to exist upon the death of Jeanette Fite?
4. Did the Trial Court err in rewriting the terms of the will of Nettie Turner Fite in order to effectuate the intention of the Testatrix, where the intention was frustrated by the negligence of defendant Brown, a creditor?
5.Did the Trial Court err in applying the doctrine of Cy Pres?
Appellants argue that the State is not entitled to be paid because it failed to conform to applicable statutes. Prior to the enactment of Chapter 323, Public Acts of 1983, the applicable law was contained in TCA 33-402 and 403. Since the claim of the State arose in 1980 and prior years, it is insisted by the State that §§ 33-402 and 403 are applicable. Since Jeanette Fite did not die until 1983, appellants insist that the provisions of the new statute, Chapter 323, Public Acts of 1983, is applicable, especially section 32 thereof (TCA 33-4-110) which provides:
Claim against estate of patient, resident, or relative. — IF (l)(A)(i) A patient or resident or former patient or resident of a facility operated by the department dies, AND
(ii) The commissioner presents a claim for a sum unpaid and owing to the state on account of such patient or resident, OR
(B)(i) A responsible relative of a patient or resident of a facility operated by the department dies, AND
(ii) The commissioner presents a claim for a sum unpaid and owing to the state on account of such patient or resident, AND
(iii) The claim against the estate of the responsible relative is not for a charge incurred more than five (5) years prior to the death of the responsible relative,
THEN
(2) The claim shall be paid as a claim against the estate of the deceased person. [Acts 1983, ch. 323, § 32.]
The substance of this section is found in the former section 33-403. Therefore, it is immaterial whether the former statute or the present statute is applicable.
The clear intent of the statute is to provide a means of collection of claims due the State for institutional care. It was not intended to exclude other remedies.
Appellants cite Cox v. State, 222 Tenn. 606, 439 S.W.2d 267 (1969). In that case, *560the Supreme Court affirmed a judgment in favor of the State and against the guardian of a non compos patient at a State Facility. Appellants argue that the success of the State in that case is tantamount to a ruling that claims of the State for keep of incompetents must be prosecuted in identically the same way. This is a non sequitur. The same opinion holds that delay or failure to pursue other remedies did not prevent the State from succeeding in that case.
Appellants assert that the State is not entitled to recover in the present case unless it sues or otherwise judicially seeks payment from the estate of the deceased as was done in the case of the estate of the incompetent in Cox. As stated, the State is not limited to the remedy pursued in Cox, but may pursue any available legal or equitable remedy.
It is true, as insisted by appellants, that the interest of Jeanette Fite in the subject trust ceased at the time of her death. So far as this record discloses, Jeanette Fite had no estate at her death, and there was no administration in which a claim might have been presented or prosecuted.
Appellants cite State ex rel. Eastern State Psychiatric Hospital vs. Estate of Rainey, Tenn.1973, 490 S.W.2d 530 wherein the estate of an indigent patient was held liable when it became the recipient of a “windfall” inheritance. The case is authority for the responsibility of an estate to the extent of its assets, but is not authority for denying the State access to trust funds set aside for the very purpose of furnishing the care furnished by the State.
Appellants cite the statute, TCA 30-2-307, requiring that claims be filed with the probate court wherein estates are being administered. This statute provides a condition for collecting from the estate. It does not bar the claimant from collecting from other legitimate sources.
The terms of the trust created an equitable fund devoted to payment for the care of Jeanette Fite during her life. So long as such fund remained undistributed, it remained subject to the orders of a court of equity in carrying out the purpose of the trust.
No merit is found in appellants’ first issue.
In support of their second issue, appellants argue that the Chancellor erred in finding that the power of the trustee survived the death of the cestui qui trust in respect to payment for her care prior to her death. In addition to the provisions already cited, the testamentary instrument directed the trustee to pay the expenses of the funeral and last illness of the cestui. This provision enlarged the powers and duties of the trustee, but did not limit the time of payment for care rendered during the lifetime of the cestui.
Appellants cite Carter v. Holland, 30 Tenn. (11 Humpt.) 333 (1850), wherein the Court said:
... [Tjheir (Trustees’) general duty is to do whatever may be necessary and proper to give effect to the purposes contemplated by the trust.... 30 Tenn. at 338.
It is clear to this Court that the primary purpose of the trust was to provide care for Jeanette Fite during her life. The payment for care after it was furnished was clearly within the purpose of the trust. A dishonest or fraudulent purpose cannot be imputed to the settler of the trust. That is to say, it cannot be presumed that the settler of the trust intended that the trustee stall and delay in payment for care until the cestui’s death, then refuse payment in order to increase the share of the remaindermen.
It is true, as insisted by appellants, that the provision for payment of expenses of funeral and last illness is directory, whereas the provision for lifetime care is discretionary. However the difference is of no consequence in this controversy. Discretion might have been desirable to limit expenditures and preserve the trust funds so long as the cestui lived and continued to need care. However, upon the death of the cestui, there was no longer an anticipation of future need, and the fund could wisely *561be required to pay last expenses of the cestui.
Appellants insist that the plain language of the trust instrument requires that, upon the death of the cestui, the trustee shall pay expenses of funeral and last illness and forthwith distribute the remainder. This Court does not so construe the intent of the settler. As previously pointed out, delay in payment until after the death of the cestui should not affect the intent of the settler that care be paid for, nor should it defeat such a claim presented before but prosecuted after the death of the cestui.
No merit is found in the appellants’ second issue.
In support of their third issue, appellants argue that the beneficial interest of the cestui ceased at her death, hence there was no beneficial interest for the State to reach in satisfaction of its claim.
This Court does not so interpret the basis of the claim of the State.
When the State furnished care to the cestui, it acquired an equitable right to claim payment from the trustee under the terms of the trust. It is true that the right to collect the claim was limited by the discretion of the trustee as to which the trustee is entitled to the instructions of a court of equity. 90 C.J.S. Trusts, § 261(c) pp 311 et seq. Cowan v. Hamilton National Bank, 177 Tenn. 94, 146 S.W.2d 359, cert den. 313 U.S. 592, 61 S.Ct. 1116, 85 L.Ed. 1596; Third Nat. Bank v. Hall, 30 Tenn.App. 586, 209 S.W.2d 46.
Appellants insist, correctly, that, upon the death of a life tenant, the interest of the life tenant ceases and the rights of the remainderman becomes absolute. However, this case is not a life tenant-remain-derman situation. This is a case of a trust to provide care for life with residue of trust to remaindermen. In this case the rights of the remaindermen do not ripen into an absolute right until the purposes of the trust have been satisfied.
In the absence of specific provisions for termination, a trust will continue as long as may be necessary to accomplish the purpose for which it was created. 89 C.J.S. Trusts § 92 p. 92 n. 98. When the purpose of the trust has been accomplished, legal title then vests in the designated residuary beneficiary. First American Bank v. Cole, 211 Tenn. 213, 364 S.W.2d 875 (1963).
In the present case, until the trustee had completed the satisfaction of the purposes of the trust, legal title to the residue did not vest in the appellants. After the death of Jeanette Fite, the appellants had a right to require the trustee to execute fully the trust and pay over the residue to them, but they had no right to immediate payment of the amount on hand until the trustee had exercised its discretion as to payment of obligations for care incurred prior to death of the cestui.
No merit is found in the appellants’ third issue.
Appellants next insist by their fourth issue that the Chancellor “rewrote the will of the testator” to avoid the frustration of the intent by the delay in legal prosecution of the claim of the State. This Court disagrees with the characterization of the action of the Chancellor.
In the view of this Court the Chancellor correctly interpreted and enforced the intent of the settler of the trust.
No merit is found in appellants’ fifth issue.
Finally, appellants insist that the Chancellor erred in invoking the doctrine of cy pres.
The words, cy pres, mean “as near as possible”, and they designate a rule of construction whereby courts of equity, in the construction of instruments, endeavor to carry out the intention of the party as “near as may be”, where it is illegal or impossible to give the instrument literal effect. Blacks Law Dictionary, Fourth Edition p. 464.
Appellants cite Henshaw v. Flenniken, 183 Tenn. 232, 191 S.W.2d 541 (1945) which holds that the doctrine of cy pres is not in force in Tennessee.
*562However, the Chancellor did not divert trust funds to an undesignated purpose. He applied them to the very purpose of the trust.
No merit is found in appellants’ fifth and last issue.
The decree of the Chancellor is affirmed. Costs of this appeal are taxed against appellants. The cause is remanded to the Chancery Court for such further proceedings, if any, as may be necessary and proper.
Affirmed and remanded.
LEWIS and CANTRELL, JJ., concur.