Made improvements on the grammar and implemented it in the parser.