applying the new way to calculate similarity