better pretty-print function