Creates output file. Attempted correct on parallelised loop.