switching according to number of matches in colmn