add cos similarity algorithm