rewrote the buffer