R code. Small other formattings.