Modified the grammar to avoid dangling else problem.