the conversion code