Adjusted the logic in cdeModel.