calculate distance between points fix