add simple ringbuffer implementation