Great, Thank you.

I viewed a plot and I think something is wrong.
Could you check if this conversion is identical to the original code?