Improved formatting of text output