2D circular buffer rough implementation