working code except for next closest destination when result is 0