pretty printing reworked