formatted output to exercise 2