changed the malloc to use an actual character size instead of a hardcoded value