Update file writing for comments