Circular buffer implementation is faster.