added a buffer data function.