rewriting lots of stuff