Fix in ddt algorithm