implementing algorithm: DCDT