Updated R source code