Combined S/N search functions into one