added closing section, improved formatting of r code