added ClearBuffer() method