Update buffer.cpp