update ScratchBuffer()