writing to files in w mode.