rewrite pi