Got the rewrite idea working