Similarity metrics

stuff. refactoring!