use a StringBuilder instead of concatenation in a for loop