Hints offered to the user are sorted by distance.
Changed the code for calculating distance.