Updated class version and made the grammar permissive in terms of commata to make the rewriting simpler