Mathematical derivation of CDA algorithm done