output formatting tidy up