Updated R program