rewrote addchar