added euclidean distance algorithm