bug fix. euclidean distance calculation was incorrect.