Start of buffer implementation code