tanimoto distance and refactor
code clean up