rewrite the code.