more documentation and pretty-printing