cdp/ex3 FINALIZED source code