Converter main function