Change the conversion code to iterative solution.