Edited template so R example runnable
Some minor changes to the template example