changes for working with buffers