third rewrite