adding a resizable ring FIFO buffer