verified writes to file