added pretty_output() function