Dynamic programming approach to optimizing stem conversion [A]