instead of sequence of  3 "ifs" may be if-elseif is more appropriate? (appears for all lepton categories)