Added named parameters to cosine func