Output formatting and order
removing globals exposed lots of ugliness in the code; love it!