add simple ringbuffer implementation

First ringbuffer implementation.