switched to StringBuilder from StringBuffer