rewrite map