added write sample