combine euclidean dist to original function