Dcm logit rebased

rebased version of PR #1120

no python 2-3 common code adjustments yet