return more information in guess_location and improve distance function