implemented the question rewrite part