added pretty print function