buggy rewriting