Add logic to output for file