moved string buffer functions into a separate file