rewrite pow