Printer rewritten slightly