Updated rewrite