fixes algorithm for computing squared (Euclidean) distance.
Merge pull request #23 from policecar/master

fixes algorithm for computing squared (Euclidean) distance.