Updates to the R file from long ago