on a click, the progam now returns the optimized way to go to the destination