changed toString to use StringBuilder