lat long function ordering