update to AD.R file