Calculating the Distance between Two Points