fixed text output to preserve formatting
minor style changes