rewrite entire codes