update example, add packets to writebuffer