Revising this script for new Knitr, partially done.