added DD code untested