now writing to the file