reworking R code to do roxygen