towards functional R code...