simplified variable selection code, added ret to SF and TF- LG