pretty printer to consider precedence