Add logic to output file.