similarity functions to separate file similarity.R