fixing the grammar to handle numeric states correctly