improve GLR algorithm