Did refactoring by adding a function called doParagraph that would write out the current results to the document, contained inside a paragraph element.