first stab at circular buffer