rewrite diff example, tidy