
331 So.2d 626 (1976)
Elizabeth S. SNOW
v.
Martha Gayle ABERNATHY et al.
Martha Gayle ABERNATHY et al.
v.
Elizabeth S. SNOW.
SC 1186, SC 1186-X.
Supreme Court of Alabama.
April 30, 1976.
*627 Zeanah, Donald, Lee & Williams, Tuscaloosa, for appellant and cross-appellee.
McCoy Davidson, Tuscaloosa, for appellees and cross-appellants.
EMBRY, Justice.
Elizabeth S. Snow appeals from judgment that declared Code of Ala., Tit. 55, § 460(6)(c), as applied to the facts of this case, in part unconstitutional and in another part constitutional.
Martha Gayle Abernathy, Judy Tucker and Michael David Snow, cross-appeal complaining of that part of the judgment favorable to Elizabeth S. Snow.

The Case
The Code section, subject of the declaration in the judgment from which this appeal and cross-appeal are taken, is one of the provisions of the Employees' Retirement Systems Act. The Retirement Systems govern retirement benefits of certain employees of the State of Alabama and certain employees of participating counties, cities, towns and public or quasi public organizations. The Systems were first established by Act No. 515, Regular Session of the Legislature of Alabama of 1945. An amendment, pertinent to this case, was enacted in 1967.
Abernathy, Tucker and Snow filed an action against Elizabeth S. Snow, David G. Bronner and J. Ben Swindle. Abernathy, Tucker and Snow are the children and heirs at law of Henry O. Snow, Jr., deceased. Abernathy and her husband are executors of his Last Will and Testament. Elizabeth S. Snow is his widow. Bronner is Secretary-Treasurer of the Retirement Systems of Alabama. Swindle is Retirement Executive of the Systems. Their complaint was amended. The amended complaint sought a declaratory judgment and injunctive relief: to declare the Retirement Systems Act unconstitutional if applied to provide for return of contributions of Henry O. Snow, Jr., deceased, to the surviving spouse rather than the beneficiary (his estate) designated by him prior to the 1967 Amendment to the Act, and to enjoin payment by Bronner and Swindle of any monies held by the Retirement Systems payable by virtue of Snow's membership therein, pending final determination by the trial court of those entitled to such monies.
*628 After evidentiary hearings, without a jury, the judgment entered by the trial court provided in part:
"IT IS, THEREFORE, ORDERED, ADJUDGED AND DECREED that the 1967 and 1971 Acts of the Legislature which provide that upon the death of a member not eligible for service retirement, after 25 years of creditable service, that his contributions and the interest shall be paid to his surviving spouse are unconstitutional as impairing the obligation of its contract, as owed to Henry O. Snow, Jr., while he lived and as it devolved on his executor or estate upon his death.
"IT IS FURTHER ORDERED, ADJUDGED AND DECREED that Mr. Henry O. Snow, Jr., and the beneficiaries of the Estate of Henry O. Snow, Jr., acquired vested and contractual rights in having his contributions, plus interest, returned in accordance with the Return of Contributions (Section 6(b), as provided in Act Number 515, Alabama Legislature of 1945, which is to the person designated on a form provided by the Retirement System or to his Estate,
"IT IS FURTHER ORDERED, ADJUDGED AND DECREED that all contributions and interest payable as a result of the membership of Henry O. Snow, Jr., in the Alabama Retirement Systems are to be paid to the Register of this Court, who shall pay same to Martha Gayle Abernathy and Dr. William M. Abernathy, as Executors of the Last Will and Testament of Henry O. Snow, Jr., said payment to be for the use and benefit of Plaintiffs and the Defendant Elizabeth S. Snow and said monies shall be handled by said Executors in accordance with law. The $5,000 death benefit is to be paid to Elizabeth S. Snow.
"IT IS FURTHER ORDERED, ADJUDGED AND DECREED that the Plaintiffs are entitled to part of the relief prayed for; that the Defendant, Bronner and Swindle, in their representative capacity as officials for the Alabama Retirement Systems pay the contributions and interest portion of the monies in their care, custody and control or this portion of the monies in the Alabama Retirement Systems, which are due and payable as a result of the membership of Henry O. Snow, Jr., in said systems to the Register of this Court. The $5,000 death benefit is to be paid to Elizabeth S. Snow in accordance with the normal procedure of the System. Upon such payments any and all liability, claims and demands against the Alabama Retirement Systems, the Defendants Bronner and Swindle, individually and in their representative capacity shall be and they hereby are terminated and ended."

The Facts
Henry Snow was employed by the City of Tuscaloosa on August 1, 1943. The Employees' Retirement Systems were established by legislative act some two (2) years subsequent to his employment. Henry Snow elected to become a member of the Retirement Systems in 1947, by executing a written instrument. By that same document he designated his first wife, Martha Gayle Snow, beneficiary as permitted by Act No. 515, Regular Session of the Alabama Legislature of 1945. In pertinent part that Act provided:
"* * * (b) Should a member die before retirement, the amount of his contributions with such interest as would have been returnable in the case of withdrawal as provided in paragraph (a) of this subsection shall be paid to his estate, or to such person as he shall have nominated by written designation duly executed and filed with the board of control. * * *"
Henry Snow divorced his first wife, Martha Gayle, in 1965, and changed his beneficiary from her to his estate. On August 28, 1966, Snow married the appellant, Elizabeth *629 S. Snow who became his widow upon his death during January 1974. By 1967 Amendment to Retirement Systems Act (Code of Ala., Tit. 55, § 460(6)(c)), Act No. 515, Acts of Alabama, 1945, Regular Session, was changed as it pertained to return of contributions. Also, the 1967 Amendment designated the surviving spouse as beneficiary to whom contributions would be returned and added a surviving spouse benefit.
It provided in part:
"* * * (c) In case of the death of a member not eligible for service retirement, after completion of twenty-five years of creditable service, an allowance shall be paid to the surviving spouse in an amount that would have been payable if the member had retired for disability immediately prior to his death and had elected Option 3, as set forth in subsection (7) of this section, or if the surviving spouse desires he may choose to receive the accumulated contributions of the member in lieu of the allowance provided under Option 3 plus an amount equal to the accumulated contributions of the member not to exceed $5,000.00; or (d) Upon the death of a member on account of whom no survivor allowance is payable under (b) or (c) above the accumulated contributions of the member plus an amount equal to the accumulated contributions not to exceed $5,000.00 shall be paid to his estate, or to such person as he shall have nominated by written designation duly executed and filed with the board of control. * * *" Code of Ala., Tit. 55, § 460(6).
After Henry Snow died, his widow, Elizabeth Snow, filed for return of her deceased husband's contributions with accumulated interest (as provided for under the 1967 Amendment) and also filed for the surviving spouse benefit that was created by that Amendment.

The Issues
The issues presented for review are:
(a) Did decedent acquire vested contractual rights, including a right to designate his beneficiary, when he became a member of the Retirement Systems in 1947?
(b) If the decedent acquired vested contractual rights, is Code of Ala., Tit. 55, § 460 (the 1967 Amendment to the Retirement Systems Act), in its application to this case, an unconstitutional impairment of those rights?
(c) Is the widow, Elizabeth Snow, entitled to the death benefit of $5,000, as provided in Code of Ala., Tit. 55, § 460(6)(c), regardless of that statute's constitutionality, or lack of it, as it was here applied?

The Decision
Issues (a) and (b) outlined above have been previously answered by this court in the case of Smith v. City of Dothan, 279 Ala. 571, 188 So.2d 532, for all practical purposes.
In Smith v. City of Dothan, supra, an employee exercised his right voluntarily to become a member of a retirement system provided for the employees of the City of Dothan under a legislative act and pay 5% of his salary as contributions toward retirement benefits. Later the legislature limited the deduction of 5% to the first $4,800 of salary and by doing so reduced monthly pension amounts payable under the plan after retirement. When the employee retired he claimed that he was entitled to benefits based upon 5% of his full salary throughout his entire contributing period of work, contending that the legislature had no right to reduce the benefits. He offered to pay the difference in the contributions that he had paid and what he would have paid under the original plan. The court ruled with the employee, holding that under a voluntary retirement program the constitutional prohibitions prohibiting *630 the passage of a law that impairs the obligation of a contract controlled and, therefore, the later legislative act which reduced his pension benefits was not controlling. In reaching this decision, this court said:
"A controlling question presented for our decision is whether under the agreed facts of this case appellant acquired a vested right of contract to pension benefits provided by law in effect at the time the amendatory Act 424, supra, was passed and approved. In other words, are appellant's rights to a retirement or pension determinable under Act 103, supra, free of the amendment impressed by Act 424?
"The Constitution of the United States, § 10, Article 1, provides that no state shall pass any law impairing the obligations of contracts, while our Alabama Constitution, Article 1, § 22 provides: `That no ex post facto law, nor any law, impairing the obligations of contracts * * * shall be passed by the legislature; * * *.'
"It is settled law that § 22, Article 1 of the Constitution of 1901 does not simply inhibit the State from impairing the obligations of contracts between individuals, but applies with like force and effect to contracts made by the State or with one of its agencies when authorized by law. Slaughter v. Mobile County, 73 Ala. 134; Sweet v. Wilkinson, 252 Ala. 343, 40 So.2d 427, 431, citing other cases.
* * * * * *
"The case of Roddy v. Valentine, 268 N.Y. 228, 197 N.E. 260, cited by the trial court in support of judgment rendered, did not recognize the distinction between voluntary and involuntary contributions by the official in question. In the lastcited case the New York court cited the case of Ball v. Board of Trustees of Retirement Fund, 71 N.J.L. 64, 58 A. 111. It is apparent from the opinion in the Ball case, supra, that the basis of the holding that contractual rights were created was where contributions were voluntary and the contract arose out of the pensioner's acceptance of the offer of a pension by voluntarily paying the contributions for the required time. Subsequent decisions of the New Jersey court, which rendered the decision in the Ball case, supra, hold that where the contributions were not voluntary no contractual rights existed with respect to the pension.
"The Supreme Court of New York, subsequent to the decision in Roddy v. Valentine, supra, recognized as a determining factor, as to whether a pension law created contractual rights, the question vel non of compulsory contributions, citing Jones v. Valentine, 164 Misc. 443, 298 N.Y.S. 802, 804.
* * * * * *
"We have read with interest the case of State v. City of Jacksonville Beach (Fla.App.), 142 So.2d 349, 352-353, wherein the facts are not on all-fours with the case at issue in this court, but impressive statements appear in this opinion. We quote:
"`Whether a given pension or retirement plan created by an act of the legislature confers upon employees participating therein a vested right of contract depends upon whether participation is voluntary upon the election of the employee, or whether participation is mandatorily required of all persons included within the plan regardless of their desire to become members thereof.
* * * * * *
"`Contrary to the rule above stated, it is equally established by decisional law of this state that benefits provided for employees under a voluntary pension or retirement plan created by an act of the legislature may not be modified or reduced by subsequent amendatory legislation for the reason that those electing to participate in such voluntary plans acquire *631 vested rights of contract to the benefits provided therein upon acceptance of the plan, which rights may not be impaired by subsequent amendments to the act.'" Smith v. City of Dothan, 279 Ala. 571, 574, 188 So.2d 532, 534.
It is voluntary participation at the election of the employee that precipitates vesting of contractual rights of that employee in the pension or retirement plan. In this case Snow made the voluntary election by executing a written instrument expressly assenting to membership in the Retirement System. This is not to say that such is the only method of expressing assent.
Though management (or the legislature) may reserve the right to revise or amend the plan, vested rights of the employee may not be impaired and will be safeguarded. Weesner v. Electric Power Board of Chattanooga, 48 Tenn.App. 178, 344 S.W.2d 766 (1961).
A basic determining factor to a resolution of the question of whether Snow acquired vested contractual rights in the statutory retirement plan here under consideration is contribution or noncontribution to the fund. Snow contributed, therefore weight is added to the soundly reasoned conclusion that the relationship between him and the system was contractual in nature. His rights vested thereby and cannot be abrogated by legislation although legislation to improve the system is constitutionally permissible. State ex rel. O'Donald v. City of Jacksonville Beach, supra; Bardens v. Board of Trustees of Judges Retirement System, 22 Ill.2d 56, 174 N.E.2d 168; Clarke v. Ireland, 122 Mont. 191, 199 P.2d 965; Ball v. Board of Trustees of Teachers' Retirement Fund, 71 N.J.L. 64, 58 A. 111.
Snow's contractually vested right was to receive all benefits "contracted" for and included the power to designate his beneficiary. That right was provided by Act No. 515, Acts of Ala., 1945; the basis of the contractual agreement at the time of Snow's election to participate. By electing, expressly or by assent, to participate in such plan employees acquire vested rights of contract to the benefits provided therein upon acceptance of the plan. Those rights may not be impaired by subsequent legislation.
While the Constitution and law protects those rights vested in Snow, a fortiori, the law limits his rights of contract to those for which he bargained. Snow acquired no contractual rights to the added surviving spouse benefit provided by the 1967 Amendmenta statutory gratuity. Snow did, and could have done, nothing to vest in himself the right to designate who should receive a gratuitous surviving spouse benefit granted by the legislature subsequent to when his vested rights were defined in 1945 upon passage of the original Retirement Systems Act. The surviving spouse benefit, it will be recalled, was not created until 1967. Therefore while Code of Ala., Tit. 55, § 460(6)(c), is unconstitutional as applied to abrogate Snow's right to designate the beneficiary of return of contributions and interest thereon, it did not retroactively grant a concomitant designation of recipient of the $5,000 surviving spouse benefit.
The trial court correctly applied the law to the facts to find Elizabeth Snow, the widow, should receive the $5,000 death benefit; the estate of Henry Snow to receive all contributions and accumulated interest thereon; therefore, the judgment is due to be affirmed.
AFFIRMED.
HEFLIN, C.J., and MERRILL, BLOODWORTH, MADDOX, FAULKNER, JONES, ALMON and SHORES, JJ., concur.
