Implemented euclidean distance for Part C