optimizing LR generation