Revert "refactored print_text()"

This reverts commit ff22cd7797b7641e3908a0f851b444519219bf87.
Revert "Revert "refactored print_text()""

This reverts commit 92af636f7ed61bccd1b6924f9bfb15e3c72e6b8f.
print_text() refactored