tweaked code getting closest city