rewrite the compiler