Update to write tidy file