
562 So.2d 687 (1990)
Donald WALDRUP, Petitioner,
v.
Richard DUGGER, etc., Respondents.
No. 74012.
Supreme Court of Florida.
June 21, 1990.
*688 Michael E. Allen, Public Defender, and P. Douglas Brinkmeyer, Asst. Public Defender, Tallahassee, for petitioner.
Robert A. Butterworth, Atty. Gen., and Susan A. Maher, Asst. Atty. Gen., Tallahassee, for respondents.
KOGAN, Justice.
Donald Waldrup, an inmate serving a fifteen-year sentence in the Avon Park Correctional Institution for crimes he committed in 1980 and 1982, petitions this Court for writ of habeas corpus. He alleges that the 1983 amendments to Florida's gain-time statutes[1] are being applied retroactively to deprive him of an earlier release from prison, in violation of one of the ex post facto *689 clauses of the Constitution.[2] U.S. Const. art. I, § 10. We treat this as a petition for writ of mandamus and accept jurisdiction. Art. V, § 3(b)(8), Fla. Const.
Prior to 1983, state law gave the Florida Department of Corrections ("DOC") wider discretion in granting "incentive" gain-time to prisoners. Then as now, incentive gain-time was meant to reward good behavior by reducing the inmates' overall sentences. However, unlike present-day law, the pre-1983 statutes let DOC give inmates who performed "satisfactory and acceptable" work a monthly gain-time award of up to the total number of days in the month.[3] Another award of one to six days a month could be given for work performance "over and above that which may normally be expected," among other reasons.[4]
These pre-1983 awards were in addition to a "basic" gain-time award of three, six, or nine days per month, with the total number being based on the length of prior incarceration. To receive this basic gain-time award, the statute required only that the inmate perform "satisfactory and acceptable" work and be guilty of no infractions.[5] Even if these conditions were met, the basic gain-time award was subject to forfeiture for unacceptable conduct. Compare § 944.275(2)(d), Fla. Stat. (1981) with § 944.28, Fla. Stat. (1981).
Although DOC typically granted the basic gain-time awards to every inmate not guilty of any infraction, the statutory language reveals that DOC possessed considerable discretion in determining what constituted "satisfactory and acceptable" work. Such awards thus were not "automatic"  a fact underscored by a separate statement of legislative intent that directed that all forms of gain-time could "be awarded only if earned as provided herein." § 944.275(2)(a), Fla. Stat. (1981) (emphasis added). Accord Raske v. Martinez, 876 F.2d 1496, 1499 (11th Cir.1989) (concluding that basic gain-time essentially is discretionary in nature).
Thus, under this pre-1983 formula, an inmate who qualified for the best possible award could have received as many as thirty-seven days of incentive gain-time a month[6] and another nine days of basic *690 gain-time. The total possible award, in other words, could be as great as forty-six days per month, or 545 days in a typical year.[7] An inmate sentenced to fifteen years in prison thus would be eligible for release after serving only six years, assuming the inmate had received the maximum possible number of basic and incentive gain-time days.[8]
In 1983, the legislature substantially revised and simplified the gain-time statute. See ch. 83-131, § 8, Laws of Fla. Under the revision, the two earlier statutes governing incentive gain-time essentially were repealed. Id. They were replaced with a new statute that provided a maximum of twenty days of incentive gain-time per month for inmates who had engaged in "positive activities" such as training programs or diligent work.[9] The statutory language discloses that the total number of days granted by DOC was discretionary, provided the award never exceeded twenty. Thus, the 1983 reforms limited DOC's discretion by decreasing the largest possible incentive gain-time award from thirty-seven to twenty days a month.
Simultaneously, the basic gain-time statute was amended in 1983 to require a flat ten-day award every month "[a]s a means of encouraging satisfactory behavior"[10]  a one-day increase over the largest possible award available before 1983. The statute uses mandatory language, suggesting that DOC must grant the ten-day basic gain-time award each month. However, other related statutory provisions state that DOC has discretion to summarily declare any gain-time award forfeited based on certain broadly defined acts or omissions, disciplinary infractions or unlawful conduct.[11]Compare § 944.275(5), Fla. Stat. (1987) with § 944.28, Fla. Stat. (1987). In other words, DOC still retains substantial discretion to withhold an award, whether or not DOC actually exercises that discretion. Accord Raske, 876 F.2d at 1499.
Under this 1983 formulation, an inmate can receive a maximum of thirty days total gain-time for each month in prison, or 360 days in a year.[12] As a result, an inmate serving a fifteen-year sentence could be released in about seven and a half years if DOC awarded the maximum amount of basic and incentive gain-time available under the present statute.[13]
*691 Based on these computations, it thus is evident that the 1983 amendments could have the effect of increasing Waldrup's actual incarceration by up to one and a half years.
Waldrup argues that this increase, when applied to him, is an unconstitutional ex post facto law. The state, on the other hand, contends that DOC always has had discretion to deny incentive gain-time and that Waldrup thus is not entitled to habeas relief based on this record. We agree with both of these arguments, finding them not incompatible.
It is well established that a penal statute violates the ex post facto clause if, after a crime has been committed, it increases the penalty attached to that crime. The United States Supreme Court clearly established this principle in the early case of Calder v. Bull, 3 U.S. (3 Dall.) 386, 390, 1 L.Ed. 648 (1798),[14] and has adhered to this basic definition ever since. E.g., Weaver v. Graham, 450 U.S. 24, 28, 101 S.Ct. 960, 963, 67 L.Ed.2d 17 (1981) (citing Calder, 3 U.S. (3 Dall.) at 390).
The policy underlying this prohibition is "to assure that legislative Acts give fair warning of their effect and permit individuals to rely on their meaning until explicitly changed." Id., 450 U.S. at 28-29, 101 S.Ct. at 963-64 (citing Dobbert v. Florida, 432 U.S. 282, 298, 97 S.Ct. 2290, 2300, 53 L.Ed.2d 344 (1977); Kring v. Missouri, 107 U.S. 221, 229, 2 S.Ct. 443, 449, 27 L.Ed. 506 (1883); Calder, 3 U.S. (3 Dall.) at 396 (Patterson, J.); The Federalist No. 44 (J. Madison) & No. 84 (A. Hamilton)). Equally, the ex post facto clauses of the Constitution "restrict[] governmental power by restraining arbitrary and potentially vindictive legislation." Id., 450 U.S. at 29, 101 S.Ct. at 964 (citing Malloy v. South Carolina, 237 U.S. 180, 183, 35 S.Ct. 507, 508, 59 L.Ed. 905 (1915); Kring, 107 U.S. at 229, 2 S.Ct. at 449; Fletcher v. Peck, 10 U.S. (6 Cranch) 87, 138, 3 L.Ed. 162 (1810); Calder, 3 U.S. (3 Dall.) at 396 (Patterson, J.); The Federalist No. 44 (J. Madison) & No. 84 (A. Hamilton)).
A retroactive law, however, is not ex post facto unless two critical elements are present: The law must apply to events occurring before its enactment, and it must disadvantage the offender. Id. (citing Lindsey v. Washington, 301 U.S. 397, 401, 57 S.Ct. 797, 799, 81 L.Ed. 1182 (1937); Calder, 3 U.S. (3 Dall.) at 390).
We have no doubt that both the incentive and basic gain-time statutes challenged by Waldrup contain the first of these elements. For instance, the statute provides that "[o]n the effective date of the act, all incentive and meritorious gain-time shall be granted according to the provisions of this act." Ch. 83-131, § 8, Laws of Fla. (codified at § 944.275(6)(b), Fla. Stat. (1987)) (emphasis added). Similarly, the new basic gain-time formula "shall be computed on and applied to all sentences imposed for offenses committed on or after July 1, 1978." Id. (codified at § 944.275(6)(a), Fla. Stat. (1987)). Both of these gain-time revisions, then, apply to a large class of inmates like Waldrup whose offenses occurred before June 1983, when the act took effect. See ch. 83-131, Laws of Fla.
However, it is obvious that the revision of the basic gain-time statute, viewed in isolation from the rest of the statute, does not contain the second element of an ex post facto law, because it does not disadvantage Waldrup. The 1983 revisions actually increased the amount of basic gain-time available for all inmates. This works to Waldrup's advantage. As a result, no *692 violation of the ex post facto clause occurs if Waldrup's basic gain-time is computed under the present statute.
The incentive gain-time statute, on the other hand, was revised to decrease the largest possible award from thirty-seven to twenty days. The state argues that this does not render the law ex post facto, since the availability of incentive gain-time is nothing but a "mere expectancy" dependent entirely on the discretion of DOC. Be that as it may, we are forced to conclude that the 1983 amendment renders the statute ex post facto because it actually disadvantages Waldrup within the meaning of the relevant case law.
Indeed, the argument advanced by the state sounds very much like the discredited analysis employed by this Court in Harris v. Wainwright, 376 So.2d 855 (Fla. 1979). In Harris, we had denied relief after an inmate was subjected to a retroactive gain-time statute that had reduced the maximum number of gain-time days that could be awarded to him. We held that
gain time allowance is an act of grace rather than a vested right and may be withdrawn, modified, or denied.
Harris, 376 So.2d at 856.
The United States Supreme Court in Weaver directly overruled Harris, finding that
[c]ontrary to the reasoning of the Supreme Court of Florida, a law need not impair a "vested right" to violate the ex post facto prohibition... . Critical to relief under the Ex Post Facto Clause is not an individual's right to less punishment, but the lack of fair notice and governmental restraint when the legislature increases the punishment beyond what was prescribed when the crime was consummated. Thus, even if a statute merely alters penal provisions accorded by the grace of the legislature, it violates the Clause if it is both retrospective and more onerous than the law in effect on the date of the offense.
Weaver, 450 U.S. at 29-31, 101 S.Ct. at 964-65. The Weaver Court went on to reject the state's argument that an alteration in gain-time was not actually an alteration in sentence. Gain-time, held the Weaver court, "is one determinant of petitioner's prison term." Id. at 32, 101 S.Ct. at 966. In conclusion, the Weaver Court found the retroactive gain-time statute void to the extent that it "reduces the number of monthly gain-time credits available to an inmate who abides by prison rules and adequately performs his assigned tasks." Id. at 33, 101 S.Ct. at 967.
It could not be clearer that the analysis in Weaver applies as fully to discretionary gain-time as it does to "mandatory" gain-time, if the latter has ever truly existed in Florida. The Eleventh Circuit has reached this conclusion in a recent case raising exactly the issue before this Court today. Raske, 876 F.2d at 1499-1500. We agree with the Eleventh Circuit's analysis in Raske. Even the "grace" of the legislature, once given, cannot be rescinded retrospectively. Id. The Weaver opinion makes it plain that the ex post facto clause applies with equal vigor to a retroactive reduction in DOC's discretion to grant gain-time. Such plainly is the case before us today.
Accordingly, upon this opinion becoming final, DOC shall be barred from applying the 1983 reduction in incentive gain-time to inmates convicted of offenses occurring before the effective date of the 1983 act. As to Waldrup and similarly situated inmates, the effect of this holding is twofold: to reinstate the incentive gain-time statutes in force at the time of offense, and to declare unconstitutional the 1983 incentive gain-time revisions as applied to these inmates.[15] DOC thus shall recompute incentive gain-time for Waldrup and similarly situated inmates based on the formulas, and in light of the criteria, contained in the pre-1983 statute.
Nothing in this opinion, however, shall be read as restricting the discretion accorded DOC under the earlier incentive gain-time *693 statutes. This discretion remains intact. If DOC withholds all or some of the incentive gain-time available to Waldrup or similarly situated inmates under the earlier statutes, then DOC's actions cannot be challenged unless they constitute an abuse of discretion. This, however, is not an issue for the present Court to decide.
Accordingly, the writ of habeas corpus is an inappropriate remedy in this instance. Waldrup has not established a right to be released from prison, but merely a right to have his incentive gain-time recomputed as required herein. This right and the corresponding duty of DOC are clear and certain to this Court under the precedents discussed above. Mandamus will lie when such a right and duty exist. Moore v. Florida Parole & Probation Comm'n, 289 So.2d 719 (Fla.), cert. denied, 417 U.S. 935, 94 S.Ct. 2649, 41 L.Ed.2d 239 (1974). Accordingly, we treat the present petition as a request for writ of mandamus, and grant the writ.
Finally, we turn to the question of how DOC shall compute basic gain-time for Waldrup and other similarly situated inmates. As we noted earlier, there is no violation of the ex post facto clause if DOC applies the 1983 basic gain-time statute retrospectively. This is so because the 1983 revision increased the number of basic gain-time days available. Waldrup and other similarly situated inmates thus are not disadvantaged. In oral argument DOC conceded that, if allowed by this Court, it wishes to apply the new basic gain-time statute retroactively, at least partly for the sake of administrative convenience.
The propriety of such a "hybrid" statute, containing elements taken from two different legislative schemes adopted in different years, raises a question of state law.[16] If the improper portion of the present statute is not severable from its related provisions, then Waldrup and other similarly situated inmates must have all of their gain-time computations made under the earlier statute. Raske, 876 F.2d at 1502 n. 16. See Barndollar v. Sunset Realty Corp., 379 So.2d 1278 (Fla. 1979). An inability to sever effectively would render unconstitutional all other provisions in the 1983 statutes as they are applied in this case. The taint, in other words, would infect every portion of section 944.275, Florida Statutes (1987), as applied to inmates such as Waldrup.
In the past, we have said that severability depends on the following test:
When a part of a statute is declared unconstitutional the remainder of the act will be permitted to stand provided: (1) the unconstitutional provisions can be separated from the remaining valid provisions, (2) the legislative purpose expressed in the valid provisions can be accomplished independently of those which are void, (3) the good and the bad features are not so inseparable in substance that it can be said that the Legislature would have passed the one without the other and, (4) an act complete in itself remains after the invalid provisions are stricken.
Cramp v. Board of Public Instruction, 137 So.2d 828, 830 (Fla. 1962). Accord Smith v. Department of Ins., 507 So.2d 1080, 1089-90 (Fla. 1987); State v. Lee, 356 So.2d 276, 283 (Fla. 1978).
First, we believe it is possible to strike the 1983 incentive gain-time provision from its related enactments and replace it with the pre-1983 incentive gain-time provisions. The resulting hybrid is both coherent and enforceable, and differs from the present statute primarily in that DOC has discretion *694 to award more incentive gain-time, as required by the Constitution.
Second, in light of the ex post facto clause, we believe the central legislative purpose remains intact if we permit DOC to enforce this hybrid statute. No violence is done to the central policies of (1) providing basic gain-time at a uniform rate per month, and (2) giving DOC discretion to award incentive gain-time as a way of encouraging good behavior.
Third, we believe it entirely possible that the legislature, had it fully appreciated the requirements of the ex post facto clause, would have entertained the solution proposed by DOC today. Thus, the "good" and "bad" features of the present act cannot be deemed inseparable.
Fourth, we find that the hybrid proposed by DOC results in a statute complete in itself. The legislative policies remain intact, and the requirements of the Constitution are met. DOC retains discretion to award incentive gain-time as a way of encouraging good behavior, and to award basic gain-time in a manner consistent with present law.
For the foregoing reasons, we find no impediment to DOC applying both the present basic gain-time statute and the pre-1983 incentive gain-time statutes to inmates such as Waldrup. However, since DOC chooses to apply this policy to Waldrup, the equal protection clauses of the state and federal constitutions require that DOC shall treat all other similarly situated inmates the same.
For the foregoing reasons, we treat Waldrup's petition as a request for mandamus, and grant the request. Trusting that respondents will fully comply with the views expressed in this opinion, we withhold issuance of the writ.
It is so ordered.

ON MOTION FOR CLARIFICATION.
Respondent Richard Dugger petitions this Court for clarification of the above opinion. We grant the motion, reaffirm the views expressed in the opinion above, and attach the following supplement to it.
Although the issue was not raised in the prior proceedings in this case, Dugger points out that a considerable number of inmates in the Florida correctional system committed crimes that predated the more liberal gain-time statute enacted on July 1, 1978. Thus, prior to this amendment, inmates apparently were entitled to gain-time awards considerably less than those authorized by the statute in effect between 1978 and 1983. Similarly, the statute in effect at the present time potentially offers more gain-time to inmates than the pre-1978 statute. However, as is obvious from the opinion above, the greatest amount of gain-time was potentially available to inmates between 1978 and 1983.
Dugger asks us to clarify the status of those inmates whose crimes predated the 1978 enactment.
As the analysis of the above opinion discloses, there is no ex post facto violation if a statutory change results in an advantage to the inmate. Weaver, 450 U.S. at 28-29, 101 S.Ct. at 963-64. Thus, the ex post facto clause is not offended if DOC applies later-enacted statutes that permit inmates potentially to receive more gain-time than was available at the time of their respective criminal offenses. See id.
We also agree with DOC that gain-time statutes do not create vested rights until gain-time actually is awarded, subject to all other applicable statutory conditions. Thus, inmates convicted of crimes prior to the 1978 amendments who have not actually received a valid award of gain-time have no vested right in the potential amount of gain-time available under either the 1978 and 1983 statutory amendments. They only have the ex post facto protections elaborated in the opinion above. Thus, subject to the requirements of the equal protection clause, DOC has discretion to apply the 1983 amendments to inmates convicted of crimes occurring prior to the 1978 amendments, even though the same statute could not be applied constitutionally to those whose crimes occurred between the 1978 and 1983 amendments.
*695 This result is compelled, we believe, by our own precedent in Connell v. Wade, 538 So.2d 854, 855-56 (Fla.), cert. denied, ___ U.S. ___, 110 S.Ct. 92, 107 L.Ed.2d 56 (1989). There, we found no violation when a defendant attempted to avail himself of a more lenient set of sentencing guidelines that had taken effect after the crime was committed, but that had expired before sentencing occurred. Id. Similarly, inmates have no absolute right to avail themselves of a separate, intervening gain-time statute that is more lenient than both the statute in effect at the time of the offense and the one presently in effect. See id.
We caution, however, that these abstract principles are not necessarily dispositive of all conceivable factual issues that might be raised by inmates convicted of offenses occurring before the 1978 amendments. For example, such inmates still might allege an abuse of discretion, a failure to adhere to other valid statutory requirements or a failure to equally apply the gain-time statutes to all similarly situated inmates. We cannot and do not attempt to resolve such matters in this motion for clarification.
For the foregoing reasons, we readopt in full our prior opinion in this cause and attach this supplement to it.
It is so ordered.
EHRLICH, C.J., and OVERTON, SHAW, BARKETT and GRIMES, JJ., concur.
McDONALD, J., concurs in result only.
NO MOTION FOR REHEARING WILL BE ENTERTAINED.
NOTES
[1]  See ch. 83-131, § 8, Laws of Fla.
[2]  Article I, section 10, the United States Constitution, makes it unconstitutional for a state to "pass any ... ex post facto Law." A nearly identical clause in article I, section 9, imposes a similar restriction on Congress.
[3]  Section 944.275(2)(b), Florida Statutes (1981), provided in pertinent part:

(b) The [Department of Corrections] is authorized to grant additional gain-time allowances on a monthly basis, as earned, up to 1 day for each day of productive or institutional labor performed by any prisoner who has committed no infraction of the rules of the department or of the laws of this state and who has accomplished, in a satisfactory and acceptable manner, the work, duties, and tasks assigned. Such gain-time allowances under this section shall be awarded on the basis of diligence of the inmate, the quality and quantity of work performed, and the skill required for performance of the work.
[4]  Section 944.275(3)(a), Florida Statutes (1981), provided:

(3)(a) An inmate who faithfully performs the assignments given to him in a conscientious manner over and above that which may normally be expected of him, against whom no disciplinary report has been filed within the preceding 6 months, and whose conduct, personal adjustment, and individual effort towards his own rehabilitation show his desire to be a better than average inmate or who diligently participates in an approved course of academic or vocational study may be granted, on an individual basis, from 1 to 6 days per month extra gain-time to be deducted from the term of his sentence.
[5]  Section 944.275(1), Florida Statutes (1981), provided:

(1) The department shall grant the following deductions for gain-time on a monthly basis, as earned, from the sentence of every prisoner who has committed no infraction of the rules of the department or of the laws of the state and who has performed in a satisfactory and acceptable manner the work, duties, and tasks assigned, as follows:
(a) Three days per month off the first and second years of the sentence;
(b) Six days per month off the third and fourth years of the sentence; and
(c) Nine days per month off the fifth and all succeeding years of the sentence; and the prisoner shall be entitled to credit for a month as soon as the prisoner has served such time as, when added to the deduction allowable, would equal a month.
[6]  This calculation is based on a 31-day month.
[7]  This calculation is based on a year containing seven 31-day months, four 30-day months and one 28-day month. The figure would have been 546 possible days in a leap year. Obviously, it is not possible to receive an award of 46 days in those months containing fewer than 31 days.
[8]  Not counting the additional day in leap years, a 15-year sentence would be reduced each year by 365 days of actual confinement plus 545 days of gain-time. Thus, the total sentence of approximately 5,475 days would be reduced by 910 days for every year actually served. Using these computations, the total sentence would be served in slightly more than six years.
[9]  The statute provides:

For each month in which a prisoner works diligently, participates in training, uses time constructively, or otherwise engages in positive activities, the department may grant up to 20 days of incentive gain-time, which shall be credited and applied monthly.
§ 944.275(4)(b), Fla. Stat. (1987).
[10]  The statute provides:

(4)(a) As a means of encouraging satisfactory behavior, the department shall grant basic gain-time at the rate of 10 days for each month of each sentence imposed on a prisoner, subject to the following:
1. Portions of any sentences to be served concurrently shall be treated as a single sentence when determining basic gain-time.
2. Basic gain-time for a partial month shall be prorated on the basis of a 30-day month.
3. When a prisoner receives a new maximum sentence expiration date because of additional sentences imposed, basic gain-time shall be granted for the amount of time the maximum sentence expiration date was extended.
§ 944.275(4)(a), Fla. Stat. (1987).
[11]  For instance, any gain-time award is subject to summary forfeiture if inmates "refuse to carry out any instruction duly given ... [or] neglect to perform the work, duties, and tasks assigned to him in a faithful, diligent, industrious, orderly, and peaceful manner." § 944.28(2)(a), Fla. Stat. (1987).
[12]  Leap years are irrelevant under the 1983 reforms, since all computations are based solely on months, not days.
[13]  The length of the sentence would be reduced by 365 days of actual confinement plus 360 days of gain-time. Thus, for each year served, the sentence would be reduced by 725 days, assuming DOC has given the inmate the maximum amount of gain-time. This results in an actual confinement of about seven and a half years.
[14]  Justice Chase in Calder v. Bull, 3 U.S. (3 Dall.) 386, 390, 1 L.Ed. 648 (1798), defined an ex post facto law as:

1st. Every law that makes an action, done before the passing of the law, and which was innocent when done, criminal; and punishes such action. 2nd. Every law that aggravates a crime, or makes it greater than it was, when committed. 3rd. Every law that changes the punishment, and inflicts a greater punishment, than the law annexed to the crime, when committed. 4th. Every law that alters the legal rules of evidence, and receives less, or different, testimony, than the law required at the time of the commission of the offence, in order to convict the offender.
[15]  We emphasize that this opinion voids the 1983 incentive gain-time statute only as applied to inmates convicted of offenses occurring before the 1983 amendment took effect. We are not confronted with, and we do not address, any issue regarding the facial validity of the statute.
[16]  At the outset, we note that the courts should disfavor creating a hybrid statute comprised of parts taken from both present-day and superseded enactments. Such an action interjects the judiciary into a realm of policy considerations that properly belongs to the legislature. However, we entertain a hybrid here only because we have been requested to do so by the administrative agency entrusted by the legislature to oversee and administer the particular statutes now under review. Because DOC exercises this broad prerogative, we believe it has authority to waive any objection the state otherwise might raise regarding the creation of a hybrid statute of the type suggested here. Accordingly, we proceed to determine whether severability is proper under Florida law.
