could possibly overwrite memory if numchars != numchars16