converted to knitr from sweave