Started code to combine lin similarity and frequency threshold