Modified Ringbuffer

It can compile but not work properly