changed the euclidean function