The existence of "off" instead of "0" here appears to be the only difference between toDtI and toDt. toDt's body should be replaced with a single call to doDtI(pdt, 0).