Calculation portion finished. Writing to a file next.