added buffer implementation