used euclidean distance to determine the likelihood