Rewrite example to use util.print and util.format where appropriate