moving dtconv out of R