added bitstream writer