redesigned the string handling