naive circular buffer implemented