working version of the ILR elimination tested with multiple grammar