add new struct and fix some bugs in the grammatic