restored scott's changes to compare
Merge pull request #12 from surette/distance-function

restored scott's changes to compare