improved ring buffers a bit