added grammar rewriting in order to interact with gogll