Complete some work on prettyprinting