rewriting error diffusion with circular buffers