When the reviewing court finds Cunningham/Blakely error, the remedy is remand for resentencing, as opposed to an order for imposition of amended sentence. In the state court, petitioner pled guilty to robbery and accompanying enhancements and was sentenced to the upper term for the robbery. Petitioner appealed, contending the trial court erred in selecting the upper term because he was denied his right to a jury trial on factors supporting the upper term. (Blakely v. Washington (2004) 543 U.S. 296.) The state appellate court found no error. Two years later Cunningham v. California (2007)549 U.S. 270 was decided and petitioner filed a writ of habeas corpus in federal district court, Northern District of California. Expressing concern that California’s answer to the Cunningham ruling, People v. Sandoval (2007) 41 Cal.4th 825 (directing remand for resentencing), raised serious ex post fact concerns, the district court, after finding no support on the record for the upper term, ordered California to fix the sentence at the middle term. The Ninth Circuit agreed with respondent that the proper remedy was remand for resentencing under the Sandoval procedure. The district court’s responsibility is to ensure that petitioner is sentenced under a constitutional procedure, not to establish the sentence itself.