added RingBuffer template class