modifying grammar for new format