how cd works