changed Euclidean distance to log