Added logic to output to file.