changed to scipy built in cosine dinstance computation