removed excess code, documented pretty print