write_chr implemented