Adding a method for calculating cosine distance