Improved output formatting

Shuffled some things around to make it easier for the user to understand what is going on.