Adding the ring buffer