finish writing to file by cout operators