Formatted the document and fixed the final plot