Add support for different output formats in main program