JS circular buffer done