copy/modify animint conversion code