Added more-flexible output formatting