implementing GLR(WIP)