Added writing to a file.