
75 Cal.Rptr.2d 402 (1998)
64 Cal.App.4th 850
The PEOPLE, Plaintiff and Respondent
v.
Daniel Vaughn ENLOW, Defendant and Appellant.
No. D027175.
Court of Appeal, Fourth District, Division One.
June 10, 1998.
Review Denied September 23, 1998.
*403 Cynthia M. Sorman, under appointment by the Court of Appeal, San Diego, for Defendant and Appellant.
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Gary W. Schons, Assistant Attorney General, Holly D. Wilkens and Gary W. Brozio, Deputy Attorneys General, for Plaintiff and Respondent.

OPINION ON REHEARING
KREMER, Presiding Justice.
In July 1996, Daniel Vaughn Enlow pleaded guilty to one count of auto theft (Veh. Code, § 10851, subd. (a)) based on an auto theft he committed in November 1995 and admitted having a prior auto theft conviction. He also admitted having a prior conviction within the meaning of the three strikes law (Pen.Code, § 667, subds. (b)-(i)). In exchange for pleading guilty, the prosecutor dismissed numerous other counts as well as allegations Enlow had served four prior prison terms (Pen.Code, § 667.5, subd. (b)). As stipulated by the plea agreement, the court sentenced Enlow to an eight-year term. This term reflected a middle term of four years for a recidivist auto thief (Pen.Code, § 666.5) doubled because of Enlow's prior strike conviction.
On appeal, Enlow contends that his sentence must be reduced by two years because the Legislature reduced the punishment in Penal Code section 666.5 for recidivist auto thieves as of January 1, 1997 before Enlow's case became final. We conclude that Enlow is precluded from raising the matter on appeal not only because he failed to obtain a certificate of probable cause and because he failed to seek withdrawal of his guilty plea, but also because he is not entitled to be sentenced under the post-January 1, 1997, version of the statute.

DISCUSSION

I

Failure to Obtain Certificate of Probable Cause
Pursuant to Penal Code section 1237.5, "[n]o appeal shall be taken" from a judgment of conviction obtained by plea of guilty or no contest unless the defendant has filed a written statement of cognizable grounds for the appealgrounds "going to the legality of the proceedings"and the trial court has certified the existence of probable cause for appeal. The courts have recognized two exceptions to this rule: (1) "issues relating to the validity of a search or seizure, for which an appeal is provided under [Penal Code] section 1538.5, subdivision (m)" and (2) "issues regarding proceedings held subsequent to the plea for the purpose of determining the degree of the crime and the penalty to be imposed." (People v. Jones (1995) 10 Cal.4th 1102,1106, 43 Cal.Rptr.2d 464, 898 P.2d 910.) No certificate of probable cause was obtained in this case.
Enlow contends a certificate of probable cause was not necessary in this case because he is not challenging the validity of his guilty plea, only the sentence imposed. The Supreme Court, however, in People v. Panizzon (1996) 13 Cal.4th 68, 78, 51 Cal.Rptr.2d 851, 913 P.2d 1061, held that a certificate of probable cause is necessary when a defendant challenges a stipulated sentence which was an integral part of the plea bargain.[1] Here, in exchange for Enlow's guilty plea, the prosecution dismissed numerous counts and the sentence was negotiated by the parties to be a stipulated term of eight years. As in Panizzon, the stipulated sentence was an integral part of the plea agreement. Accordingly, a certificate of probable cause was necessary and Enlow's failure to obtain a *404 certificate of probable cause bars review on appeal.

II

Challenge of Sentence Without Seeking to Withdraw the Guilty Plea
Even if we were to assume a certificate of probable cause was not necessary here, we would not order Enlow's sentence reduced. As explained in part I, ante, Enlow's sentence was an integral part of his plea agreement which involved the dismissal of numerous other counts. "Critical to plea bargaining is the concept of reciprocal benefits. When either the prosecution or the defendant is deprived of benefits for which it has bargained, corresponding relief will he from the concessions made." (People v. Collins (1978) 21 Cal.3d 208, 214, 145 Cal.Rptr. 686, 577 P.2d 1026.) Relief for the prosecutor when a defendant challenges part of a plea agreement may take the form of restoring the dismissed counts and proceeding to trial (id. at p. 215, 145 Cal.Rptr. 686, 577 P.2d 1026) or, alternatively, if the circumstances permit, the reviewing court may find a way to achieve the same result and give both sides the benefit of the bargain. (See People v. Harvey (1980) 112 Cal.App.3d 132, 139-140,169 Cal.Rptr. 153.)
Since the prison term was specifically negotiated by the parties, a reduction in the term would deprive the prosecution of one of the benefits for which it had bargained, i.e., an eight-year prison term. Enlow is not entitled to retain the benefit of the agreement (the dismissal of numerous other counts) while depriving the prosecution of its benefit (the eight-year term). Therefore, it would be improper for us to reduce the sentence. Enlow's remedy would be to seek withdrawal of his guilty plea.

III

No Reduction in Sentence is Merited
Finally, we conclude Enlow's argument, on the merits, is unpersuasive.
When Enlow committed the crime and was sentenced, the 1993 version of Penal Code section 666.5 was in effect. This statute provided the prison terms for recidivist auto thieves were three, four or five years. (Pen.Code, § 666.5, subd. (a).) The statute also provided that as of January 1, 1997, the increased prison terms would be repealed (i.e., would "sunset") and revert to the pre-1993 levels of two, three or four years. (Pen. Code, § 666.5, subd. (c).)
The 1993 changes were enacted as urgency legislation. The Legislature stated:
"This act is an urgency statute necessary for the immediate preservation of the public peace, health, or safety within the meaning of Article IV of the Constitution and shall go into immediate effect. The facts constituting the necessity are: [¶] In order to reinstate vehicle theft statutes with enhanced penalties which were repealed on January 1, 1993, it is necessary that this act take immediate effect." (Stats.1993, ch. 1125, § 18, p. 5084.)
Enlow argues that because his sentence was not final before January 1, 1997, the post-January 1997 penalties apply to his case. He contends his case is governed by In re Estrada (1965) 63 Cal.2d 740, 48 Cal.Rptr. 172, 408 P.2d 948. In Estrada, the defendant was convicted of escape but before he was sentenced, the Legislature reduced the penalties imposed for an escape committed without force or violence. The Estrada court concluded the defendant was entitled to the ameliorative effect of the changes. The Estrada court stated:
"The problem, of course, is one of trying to ascertain the legislative intentdid the Legislature intend the old or new statute to apply? Had the Legislature expressly stated which statute should apply, its determination, either way, would have been legal and constitutional. It has not done so. We must, therefore, attempt to determine the legislative intent from other factors.
"There is one consideration of paramount importance. It leads inevitably to the conclusion that the Legislature must have intended, and by necessary implication provided, that the amendatory statute should prevail. When the Legislature amends a statute so as to lessen the punishment, it has obviously expressly determined that its former penalty was too severe and that a lighter punishment is proper as punishment for the commission of the prohibited *405 act. It is an inevitable inference that the Legislature must have intended that the new statute imposing the new lighter penalty now deemed to be sufficient should apply to every case to which it constitutionally could apply. The amendatory act imposing the lighter punishment can be applied constitutionally to acts committed before its passage provided the judgment convicting the defendant of the act is not final. This intent seems obvious, because to hold otherwise would be to conclude that the Legislature was motivated by a desire for vengeance, a conclusion not permitted in view of modern theories of penology." (In re Estrada, supra, 63 Cal.2d 740, 744-745, 48 Cal.Rptr. 172, 408 P.2d 948.)
More recently, a Supreme Court majority has held that Estrada is inapplicable to a statute temporarily increasing penalties, a statute which was very similar to the one involved in this case. In In re Pedro T. (1994) 8 Cal.4th 1041, 36 Cal.Rptr.2d 74, 884 P.2d 1022, the Supreme Court addressed the legislative intent behind an amendment to Vehicle Code section 10851, effective January 1, 1990, which increased the maximum punishment for vehicle theft from three to four years. Like the statute involved in this case, Vehicle Code section 10851 was enacted as urgency legislation and contained a sunset clause providing the lesser punishment would revert to the earlier levels as of a specified date (January 1,1993) unless the Legislature otherwise directed. (Stats. 1989, ch. 930, § 12.5, p. 3266.) The petitioner in Pedro T., relying on Estrada, argued that once the sunset provision of the statute took effect, all persons, such as himself whose convictions were not yet final, were entitled to the ameliorative effect of the reinstated lesser punishment.
A majority of the Pedro T. court concluded the petitioner was not entitled to the ameliorative effect of the reinstated lesser punishment because, unlike Estrada, the clear legislative intent was that persons who committed crimes during the period of increased punishment were to receive the increased punishment regardless of when their cases became final. The majority noted that the increased penalties were enacted as urgency legislation required for public safety purposes and thus, "[f]ar from determining that a lesser punishment for vehicle theft would serve the public interest, the Legislature expressly declared that increased penalties were necessary. Estrada is not implicated on these facts." (In re Pedro T., supra, 8 Cal.4th 1041, 1046, 36 Cal.Rptr.2d 74, 884 P.2d 1022, italics in original.) The majority also stated:
"Our conclusion is reinforced by consideration of the practical effect of a contrary rule. The utility of a three-year legislative experiment in enhanced penalties might be seriously undermined if those penalties, instead of applying to all offenders during the three years, could be imposed only on those whose convictions became final before the sunset date. The Legislature could reasonably assume that for a deterrent to work it must operate long enough and consistently enough to convey to the public an understanding that the heavier penalty will apply during the stated effective period of the legislation. Yet under the construction the minor urges, the three-year period would in effect be reduced to something indeterminate and much less, i.e., that period of time following the effective date of the amendment in which any particular conviction that ccurred could become final before expiration of the three years. [Citation.] The validity, moreover, of any conclusions to be drawn from an experimental study of the deterrent effect of enhanced penalties could be weakened by the underinclusiveness of a sampling of offenders comprised only of those whose convictions happened to become final before the sunset date of the increased penalties." (Ibid, italics in original.)
The Supreme Court majority reasoned that a contrary rule "would provide a motive for delay and manipulation in criminal proceedings," i.e., a criminal defendant would attempt to delay the proceedings and to manipulate the system so that his case did not become final until after the period of increased penalties had lapsed. (In re Pedro T., supra, 8 Cal.4th at p. 1047,36 Cal.Rptr.2d *406 74, 884 P.2d 1022.) The majority stated, "The Legislature could not have intended to encourage such machinations." (Ibid.)
The majority rejected the argument that the Legislature's failure to extend or repeal the sunset provision indicated a legislative belief that the temporarily increased penalty was "unnecessary to the goal of deterrence" and therefore the petitioner should be extended "the benefit of the amelioration." (In re Pedro T., supra, 8 Cal.4th at p. 1047, 36 Cal.Rptr.2d 74, 884 P.2d 1022.) The majority explained:
"[L]egislative inactivity after the passage of the sunset provision casts no light on the Legislature's intent when it enacted the statute. It is axiomatic that in assessing the import of a statute, we must concern ourselves with the Legislature's purpose at the time of the enactment.... "As we have seen, the Legislature's aim in enacting the temporary sentence increases in Vehicle Code section 10851 is plain: to punish, more severely than before, persons who committed vehicle-taking within a three-year period. Even if we were to adopt the unorthodox approach advocated by the minor and espoused by the dissent, and were to embark on a search for hypothetical postenactment legislative intent based on legislative silence, our conclusion would remain the same. We have found no facts to suggest that, as of the time of the minor's offense, the original legislative aim had somehow ceased to operate, and it is impossible to discern at what point, if any, during the period of legislative inactivity the Legislature might have determined to let its experiment in enhanced penalties terminate as to all criminal proceedings not yet final as of the sunset date. Much truer to the original legislative purpose, we believe, is a determination the provision for enhanced penalties shall apply to all vehicle thefts committed during its stated effective period." (In re Pedro T., supra, 8 Cal.4th at pp. 1047-1048, 36 Cal.Rptr.2d 74, 884 P.2d 1022, italics in original.)
Here, applying the reasoning of Pedro T., we conclude that since Penal Code section 666.5 was enacted as urgency legislation, provides for a period of increased penalties and contains a sunset clause, the legislative intent was that persons such as Enlow who committed his crime during the experimental period of increased penalties are to be punished pursuant to the increased penalties.
Enlow seeks to distinguish Pedro T. He asserts that legislative activity occurring before the January 1, 1997, sunset date indicates the Legislature had decided that the lesser penalties were appropriate and should be applied to a person in Enlow's position.
In 1996, Assembly Bill No. 3170 was introduced. The original version proposed repealing the sunset clause and making the increased punishments permanent as of January 1, 1997. (Assem. Bill No. 3170 (1995-1996 Reg. Sess.) introduced by Assembly-member Martinez, Feb. 23, 1996.) The language repealing the sunset clause, however, was deleted when the bill was presented to the Senate. (Legis. Counsel's Dig., Assem. Bill No. 3170, (1995-1996 Reg. Sess.), as amended in Senate, Aug. 20,1996.) As finally enacted, the amendments to Penal Code section 666.5 which became effective on January 1, 1997, clarified what convictions qualified under the statute but did not alter the punishment, i.e., the Legislature did not delete the sunset provision for the increased penalties enacted in 1993; the penalties reverted to the pre-1993 status. (Stats. 1996, ch. 660, § 2, pp. 3020-3021.)
Enlow argues "[t]he factual difference between In re Pedro T., supra, 8 Cal.4th 1041, 36 Cal.Rptr.2d 74, 884 P.2d 1022 and the present case is that here the Legislature considered extending the experimental period that the higher punishments would remain in effect, but ultimately did not" in contrast to Pedro T. where the sunset clause elapsed. Enlow argues:
"The Legislature did not merely allow the sunset clause to take effect as the Respondent erroneously contends. [Citation.] Rather, the Legislature reenacted a new amended version of the statute containing the same lower penalties that would have taken effect under the sunset clause. The failure of the Legislature to extend the increased penalties and its reenactment of the statute with a lower range of penalties rather than simply allowing the sunset *407 clause to take effect constituted a repeal of the sunset clause and evidence a legislative determination that the experimental higher punishments were too severe and that the lighter penalties are appropriate."
This argument is unpersuasive. Nothing in the Legislature's actions in 1996 indicates an intent to alter the application of the increased penalties to crimes committed during the experimental period of the 1993 version of the statute; the Legislature left intact those provisions. Had the Legislature intended a contrary result in 1996, it easily could have so provided by including language that post-January 1, 1997, lesser penalties were to apply to all cases not yet final. We further note the legislative activity occurred after the Supreme Court's decision in Pedro T. and the Legislature presumably was aware of the Pedro T. decision (see Harris v. Capital Growth Investors XIV (1991) 52 Cal.3d 1142,1155, 278 Cal.Rptr. 614,805 P.2d 873), including the majority's position in Pedro T. that a statute containing a period of increased penalties and a sunset clause shows a legislative intent that all persons who committed crimes before the sunset date were too vulnerable to the increased penalties. The fact the Legislature left intact the period of increased penalties, in light of the Supreme Court majority's interpretation in Pedro T., further strengthens the conclusion the Legislature intended persons like Pedro who committed crimes during the period of increased penalties to receive the increased punishment.
In conclusion, Enlow was properly sentenced based on the version of Penal Code section 666.5 as it existed at the time he committed his Vehicle Code section 10851 offense.

DISPOSITION
The judgment is affirmed.
NARES and HALLER, JJ., concur.
NOTES
[1]  In Panizzon, the defendant entered a no contest plea as part of a plea bargain which included a stipulated sentence. He appealed on the basis his plea was disproportionate to the sentences imposed on his codefendants.
