add circular buffer with any element size (not just one byte)
fix header
update