Eculedian Distance with for loop and different method of calculation