using writeBuffer now, too