rewriting the ASR engine