Add file writing