debug, rewrite