more work on WriteStream
resolved merge