Rewrite - appears to be working