Modified toString to take advantage of a string buffer