rewrite digit