added cosine similaraty along with a more robust filtering engine