Add code to write to a file