cyclic buffer by array