euclidean distance and iteration halt condition added
merged with github repo