modified kSelect rec