using only one instance of StringBuilder to generate lines