Added new functions

Wrote cosine similarity function, wrote custom “algorithm” function