Finalized code, now to starting to chunk into knitr doc.