Extracted to function, ifmain
Extracted pretty-print function