Modifications to DDModel.R