with updated R file