update grammar to handle dictionary better