add magic cd calculation