updated prettyPrint functionality