Use circular buffer instead of type array.