improved ars.R