Updated to use a String buffer.