added option to run in parallel or not so that hopefully knitr won't fail
wrapped sink in expression for knitr to work