cyclic buffer works