circular buffer is working