pretty_print added to write method.