added a pretty-printing mode