Ported from dcm without trds