The Court of Appeal has commuted the death sentence of a youth to 40 years in prison and 12 strokes of the cane.