[Newbies] Efficiently writing to a file