Moved comments into functions to avoid (untitled) sections in the outline provided by the RStudio window.