updating r script