improved pretty printer