-- DAWS Package file B / Dynamic Ground War

-- CURRENTLY NOT WORKING

-- THANKS TO (cronological order):
	-- Rider (AMVI)
	-- Grimes (ED community)
	-- MBot (ED community)
	-- xcom (ED community)
	-- Ian (ED community)
	-- vicx (ED community)
	-- Pikey (ED community)
	-- ESAC_Matador (ED community)

-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################

	-- local function copy
	local base 						= _G
	local require 					= base.require
	local table 					= base.table
	local math 						= base.math
	local string					= base.string
	local pairs 					= base.pairs
	local ipairs 					= base.ipairs
	local print 					= base.print
	local io 						= base.io
	local lfs 						= base.lfs
	local os 						= base.os
	local zip 						= minizip
	local loadstring 				= base.loadstring
	--]]--
	
	-- common directory listing
	local mistdirectory 			= mistdirectoryDP -- lfs.currentdir() .. "AMVI/Common/Code/"
	local moddirectory 				= moddirectoryAE 	-- lfs.currentdir() .. "AMVI/AIEnhancement/"
	local debugdirectory  			= debugdirectoryAE	--lfs.currentdir() .. "AMVI/AIEnhancement/Debug/"
	local missionfilesdirectory 	= missionfilesdirectoryDP -- lfs.writedir() .. "Missions/"
	local logsdirectory				= logsdirectoryDP -- lfs.writedir() .. "Logs/"
	
	-- common export variables
	local exportfiletype 			= ".csv"
	--reportfiletype 				= ".doc"
	local configfiletype 			= ".csv"
	local tss 						= ";"
	
	--##### INTERNAL VARIABLES
	local MissionStartTimeSim 		= timer.getTime0()
	local debugProcess 				= true -- print information log in dcs.log
	local SuperdebugProcess			= true -- generates files in logs folder
	local StatedebugProcess			= true -- print state information log in dcs.log
	local debugProcessPLAN			= true
	local debugProcessSCHED			= true
	local debugProcessLL			= true
	local baseGcounter 				= 10000
	local saveCounter				= 0
	local StaticStartNumber 		= 0
	local loadedMissionPath 		= "" -- not used at the moment
	local DAWSAIEu_tag				= "DAWSAIEu"
	local chatMessage				= false
	local DWterritoryFilter			= true
	local groundMissionObsolescense = 60 -- minutes after a plan has been assigned will be overwritten. will be skipped if the group complete the mission.
	local globalUpdateFrequency		= "Medium" --> "Very High" --> "Medium" --> "Low" --> "Very Low" --> "Auto"
	local numberPlannedMovement 	= "Very Low" --> "Very High" --> "Medium" --> "Low" --> "Very Low" --> "Auto"


	--##### EXTERNAL VARIABLES (DAWS Package integration)
	local globalCampaignStartTime	= 0
	if DAWS_SM_startCampaign then
		globalCampaignStartTime = DAWS_SM_startCampaign
	end
	
	--##### CALCULATED VARIABLES
	local updateShift = 0.05 -- seconds between each operation done by cycling functions // not used yet
	if globalUpdateFrequency == "Very High" then
		updateShift	= 0.01 -- 100 ops/second
	elseif globalUpdateFrequency == "High" then
		updateShift	= 0.025 -- 40 ops/second
	elseif globalUpdateFrequency == "Medium" then
		updateShift	= 0.05 -- 20 ops/second
	elseif globalUpdateFrequency == "Low" then
		updateShift	= 0.1 -- 10 ops/second
	elseif globalUpdateFrequency == "Very Low" then
		updateShift	= 0.25 -- 4 ops/second
	elseif globalUpdateFrequency == "Auto" then
		updateShift	= 0.5 -- TEMPORARY --> Do an update after the first cycle
	end
	
	-- USED TO DEFINE NUMBER PLANNED OF MOMENT TOGETHER.
	local numberMovLimit = 2 -- 
	if numberPlannedMovement == "Very High" then
		numberMovLimit	= 30 -- movement
	elseif numberPlannedMovement == "High" then
		numberMovLimit	= 20 -- movement
	elseif numberPlannedMovement == "Medium" then
		numberMovLimit	= 10 -- movement
	elseif numberPlannedMovement == "Low" then
		numberMovLimit	= 5 -- movement
	elseif numberPlannedMovement == "Very Low" then
		numberMovLimit	= 2 -- movement
	elseif numberPlannedMovement == "Auto" then
		numberMovLimit	= 5 -- movement
	end
	--]]--	
	
	if debugProcessLL == true then
		env.info(("DAWS starting, globalUpdateFrequency = " .. globalUpdateFrequency .. ", numberMovLimit = " .. numberMovLimit))
	end		
	
	local GlobalSceneryTimeLetter = "X" -- MUST BE MADE TO BE CHANGED IF SCENERY CHANGE!!
	local LoadTerritory = "None"
	if env.mission.usedModules.Caucasus and env.mission.usedModules.Caucasus == true then
		GlobalSceneryTimeLetter = "D"
		LoadTerritory = "Caucasus"
	elseif env.mission.usedModules.Nevada and env.mission.usedModules.Nevada == true then	
		GlobalSceneryTimeLetter = "T"
		LoadTerritory = "Nevada"
	elseif env.mission.usedModules.StraitOfHormuz and env.mission.usedModules.StraitOfHormuz == true then	
		GlobalSceneryTimeLetter = "D"
		LoadTerritory = "Hormuz"
	end
	
	--improved random
	do
	   local oldrandom = math.random
	   local randomtable
	   math.random = function ()
		  if randomtable == nil then
			 randomtable = {}
			 for i = 1, 97 do
				randomtable[i] = oldrandom()
			 end
		  end
		  local x = oldrandom()
		  local i = 1 + math.floor(97*x)
		  x, randomtable[i] = randomtable[i], x
		  return x
	   end
	end	

-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################
-- ################################################################################################################################

		
	local allowBluePlanning = true
	local allowRedPlanning = true
	
	-- naming conventions:
	-- dist_ = distances in m
	-- spd_ = speed in m/s
	-- height = height in m or mslm
	-- territory = status can be "blue", "neutral" or "red" for ownership. "blue", "void", "contended" or "red" for controlled status		
	
	-- notes:
	-- land.isVisible(table origin, table destination )
	-- land.profile(table vec3, table vec3 ) -> definisce il profilo del terreno tra due punti. valutare se usarlo per decidere se percorso road o offroad
	

	
	--#####################################################		
	--### TacticalMovement evaulation structure layout ####
	--#####################################################		
	
	
	--[[
	to do:
		
		XX- stopped after AI, recreate:
		- sitrep if necessary
		- planning
		- review execution

		-- remove units from ORBATtable
		
		
		
		
		
		
		
		
	--]]--		
	
	
	--#####################################################		
	--### tactical engine variables #######################
	--#####################################################		

	--local dist_controlled = 5000 -- m, if two unit of different coalition are in this proxy distance from a town, the territory will be considered "contended" --> TRY TO REMOVE THIS!!
	local GlobalState = "A"
	local PastGlobalState = "X"
	local ExeMissionTimeShift = 0
	local borderLimit = 5000 -- meters.
	local nearborderLimit = 7000+borderLimit -- meters. should be "artillery" range value about...
	local enemySkirmishLimit = 6000  -- meters. if an enemy is whithin this range, than is evaluated as skirmish forces. Used in SITREP.
	local enemyArtyLimit = 15000  -- meters. if an enemy is whithin this range, than is evaluated as arty forces. Used in SITREP.
	local SITREPintelmaxentry = 5 -- define the maximum number of entry in the enemyIntel table of sitrep. Short numbers should reduce table size, improve performance but will get a more limited SA.
	local minRandomRange = 0 -- mt
	local maxRandomRange = 300 -- mt
	local DWterritoryFilterThreshold = 40000 -- m
	if env.mission.weather.clouds.iprecptns == 0 then
		StandardRoadDisable = 1 -- changed to "nil" from "1" due to the stupid behaviour of ground units in open terrain.
		StandardSpeedVel = 40
		LogisticRoadDisable = nil
		LogisticSpeedVel = 60
	elseif env.mission.weather.clouds.iprecptns == 1 then
		StandardRoadDisable = nil
		StandardSpeedVel = 40
		LogisticRoadDisable = nil
		LogisticSpeedVel = 60
	elseif env.mission.weather.clouds.iprecptns > 1 then
		StandardRoadDisable = nil
		StandardSpeedVel = 20
		LogisticRoadDisable = nil
		LogisticSpeedVel = 45
	end



	
	--#####################################################		
	--### static tables with city names and coordinates ###
	--#####################################################		
	
	-- caucasus map town and cities locations
	local CaucasusBase_towns = {
		["AATSY"] = {latitude = 43.135833,longitude = 40.746389},
		["ABADZEHSKAYA"] = {latitude = 44.392778,longitude = 40.233889},
		["ABANOETI"] = {latitude = 42.535833,longitude = 43.050000},
		["ABASHA"] = {latitude = 42.204722,longitude = 42.228611},
		["ABASHISPIRI"] = {latitude = 42.206111,longitude = 42.186111},
		["ABASTUMANI"] = {latitude = 42.398056,longitude = 41.896944},
		["ABEDATI"] = {latitude = 42.383889,longitude = 42.298889},
		["ABGARA"] = {latitude = 43.190556,longitude = 40.639444},
		["ABGARHUK"] = {latitude = 43.115556,longitude = 40.716667},
		["ABINSK"] = {latitude = 44.866111,longitude = 38.166667},
		["ABRAU-DYURSO"] = {latitude = 44.696667,longitude = 37.607222},
		["ABZHAKVA"] = {latitude = 43.025556,longitude = 41.085278},
		["ACHANDARA"] = {latitude = 43.188333,longitude = 40.736111},
		["ACHARA"] = {latitude = 42.560000,longitude = 42.880833},
		["ACHIGVARA"] = {latitude = 42.682500,longitude = 41.652778},
		["ACHKATSA"] = {latitude = 43.148333,longitude = 40.700833},
		["ACHKVISTAVI"] = {latitude = 41.829722,longitude = 41.933889},
		["ADAGUM"] = {latitude = 45.093611,longitude = 37.734444},
		["ADAMII"] = {latitude = 45.067222,longitude = 39.506944},
		["ADERBIEVKA"] = {latitude = 44.599167,longitude = 38.113333},
		["ADLER"] = {latitude = 43.615556,longitude = 39.918889},
		["ADLIA"] = {latitude = 41.618333,longitude = 41.618333},
		["ADYGEISK"] = {latitude = 44.879167,longitude = 39.202222},
		["ADZHAMETI"] = {latitude = 42.186944,longitude = 42.818889},
		["ADZHAPSHA"] = {latitude = 43.096389,longitude = 40.751111},
		["ADZHAZHV"] = {latitude = 42.803611,longitude = 41.498056},
		["ADZHHAHARA"] = {latitude = 43.207222,longitude = 40.505000},
		["ADZHIMCHIGRA"] = {latitude = 43.169444,longitude = 40.629444},
		["ADZIGEZH"] = {latitude = 43.066111,longitude = 40.967500},
		["ADZLAGARA"] = {latitude = 43.150000,longitude = 40.638056},
		["ADZYUBZHA"] = {latitude = 42.839722,longitude = 41.210833},
		["AFIPSIP"] = {latitude = 44.993611,longitude = 38.786667},
		["AFIPSKII"] = {latitude = 44.899722,longitude = 38.853611},
		["AGARAKI"] = {latitude = 43.201389,longitude = 40.423889},
		["AGOI"] = {latitude = 44.146111,longitude = 39.045556},
		["AGRONOM"] = {latitude = 45.136389,longitude = 39.201111},
		["AGUI_SHAPSUG"] = {latitude = 44.184167,longitude = 39.076944},
		["AGVAVERA"] = {latitude = 42.732500,longitude = 41.760000},
		["AHALBEDISEULI"] = {latitude = 42.379167,longitude = 42.502222},
		["AHALDABA"] = {latitude = 42.840556,longitude = 41.260278},
		["AHALHIBULA"] = {latitude = 42.435000,longitude = 42.030833},
		["AHALI-ABASTUMANI"] = {latitude = 42.528611,longitude = 41.835000},
		["AHALI-KINDGI"] = {latitude = 42.798056,longitude = 41.291111},
		["AHALI-SVIRI"] = {latitude = 42.157778,longitude = 42.927500},
		["AHALI-TERZHOLA"] = {latitude = 42.228611,longitude = 43.002778},
		["AHALKAHATI"] = {latitude = 42.465000,longitude = 41.753056},
		["AHALSHENI"] = {latitude = 43.118889,longitude = 41.036944},
		["AHALSOPELI"] = {latitude = 43.141667,longitude = 40.568333},
		["AHALUBANI"] = {latitude = 42.212778,longitude = 42.933056},
		["AHMETOVSKAYA"] = {latitude = 44.149167,longitude = 41.067778},
		["AHTANIZOVSKAYA"] = {latitude = 45.316111,longitude = 37.106667},
		["AHTYRSKII"] = {latitude = 44.847778,longitude = 38.307778},
		["AHUTI"] = {latitude = 42.468611,longitude = 42.196389},
		["AKALAMRA"] = {latitude = 43.112222,longitude = 40.791111},
		["AKAPA"] = {latitude = 43.037500,longitude = 41.141667},
		["AKVACHA"] = {latitude = 43.114722,longitude = 40.849167},
		["AKVARA"] = {latitude = 43.239444,longitude = 40.401944},
		["AL'PIISKOE"] = {latitude = 43.290556,longitude = 40.287778},
		["ALAHADZY"] = {latitude = 43.221667,longitude = 40.320833},
		["ALAMBARI"] = {latitude = 41.827222,longitude = 41.892500},
		["ALAVERDI"] = {latitude = 42.047500,longitude = 43.091111},
		["ALEKSANDROVSKII"] = {latitude = 45.250000,longitude = 40.069722},
		["ALEKSEE-TENGINSKAYA"] = {latitude = 45.205278,longitude = 40.191667},
		["ALGYT"] = {latitude = 43.128333,longitude = 40.572778},
		["ALI-BERDUKOVSKII"] = {latitude = 43.986944,longitude = 41.761111},
		["ALIONI"] = {latitude = 42.285556,longitude = 41.970556},
		["AMAGLEBA"] = {latitude = 42.084722,longitude = 42.651111},
		["AMBROLAURI"] = {latitude = 42.517778,longitude = 43.178333},
		["AMSAISI"] = {latitude = 42.130833,longitude = 43.196667},
		["AMTKEL"] = {latitude = 43.032778,longitude = 41.339722},
		["AMZARA"] = {latitude = 43.092222,longitude = 41.008889},
		["ANAKLIA"] = {latitude = 42.399722,longitude = 41.607500},
		["ANAPA"] = {latitude = 44.935278,longitude = 37.314167},
		["ANAPSKAYA"] = {latitude = 44.897500,longitude = 37.390278},
		["ANASTASIEVSKAYA"] = {latitude = 45.211944,longitude = 37.898889},
		["ANDREEVSKAYA"] = {latitude = 45.315278,longitude = 38.673333},
		["ANGISA"] = {latitude = 41.631944,longitude = 41.618889},
		["ANHASHTUN"] = {latitude = 43.236389,longitude = 40.508889},
		["ANUHVA"] = {latitude = 43.121667,longitude = 40.827222},
		["AOSYRHVA"] = {latitude = 43.198611,longitude = 40.738333},
		["APSHERONSK"] = {latitude = 44.457222,longitude = 39.742778},
		["ARADU"] = {latitude = 42.780556,longitude = 41.483333},
		["ARAKICH"] = {latitude = 42.847500,longitude = 41.269722},
		["ARASADZYH"] = {latitude = 43.234167,longitude = 40.336944},
		["ARGVETA"] = {latitude = 42.139167,longitude = 43.011389},
		["ARGVETI"] = {latitude = 42.287778,longitude = 43.471944},
		["ARHIPO-OSIPOVKA"] = {latitude = 44.374167,longitude = 38.539722},
		["ARHIPOVSKOE"] = {latitude = 45.006944,longitude = 39.863889},
		["ARHVA"] = {latitude = 43.227222,longitude = 40.583611},
		["ARHYZ"] = {latitude = 43.564722,longitude = 41.297778},
		["ARMYANSKII"] = {latitude = 44.858889,longitude = 37.999444},
		["ASFAL'TOVAYAGORA"] = {latitude = 44.460833,longitude = 39.456111},
		["ASHE"] = {latitude = 43.956111,longitude = 39.283889},
		["ASKANA"] = {latitude = 41.950278,longitude = 42.183333},
		["ASSOKOLAI"] = {latitude = 44.842500,longitude = 39.479444},
		["ATSANA"] = {latitude = 42.046389,longitude = 42.092778},
		["ATSYDZHKVA"] = {latitude = 43.206667,longitude = 40.355000},
		["ATYDZTA"] = {latitude = 43.212778,longitude = 40.410833},
		["AUALITSA"] = {latitude = 43.171667,longitude = 40.680833},
		["AZOVSKAYA"] = {latitude = 44.788889,longitude = 38.630556},
		["BABUSHARA"] = {latitude = 42.853056,longitude = 41.132500},
		["BADZHI"] = {latitude = 42.546111,longitude = 42.995833},
		["BADZHITI"] = {latitude = 42.340278,longitude = 43.396389},
		["BAGAZHIASHTA"] = {latitude = 42.916944,longitude = 41.146944},
		["BAGDADI"] = {latitude = 41.931389,longitude = 42.113056},
		["BAGDATI"] = {latitude = 42.070833,longitude = 42.844722},
		["BAGIKYTA"] = {latitude = 43.128889,longitude = 40.711111},
		["BAGLAN"] = {latitude = 42.832778,longitude = 41.191111},
		["BAGMARANI"] = {latitude = 42.469167,longitude = 41.980833},
		["BAKINSKAYA"] = {latitude = 44.762778,longitude = 39.300000},
		["BAMBORA"] = {latitude = 43.102222,longitude = 40.609444},
		["BANDZA"] = {latitude = 42.347500,longitude = 42.310000},
		["BANODZHA"] = {latitude = 42.285000,longitude = 42.684722},
		["BARANIKOVSKII"] = {latitude = 45.341111,longitude = 38.028611},
		["BARANOVKA"] = {latitude = 43.676667,longitude = 39.730000},
		["BARDUBANI"] = {latitude = 42.204444,longitude = 42.913889},
		["BAREULI"] = {latitude = 42.539444,longitude = 43.038889},
		["BARI"] = {latitude = 42.527500,longitude = 43.324167},
		["BARMYSH"] = {latitude = 43.218056,longitude = 40.502778},
		["BASHI"] = {latitude = 42.566667,longitude = 41.946111},
		["BASILETI"] = {latitude = 41.956111,longitude = 42.170833},
		["BATARIA"] = {latitude = 42.286389,longitude = 42.033889},
		["BATUMI"] = {latitude = 41.645278,longitude = 41.663889},
		["BAZALETI"] = {latitude = 42.030278,longitude = 43.232500},
		["BEKESHEVSKAYA"] = {latitude = 44.115000,longitude = 42.457500},
		["BELOE"] = {latitude = 45.046667,longitude = 39.661944},
		["BELORECHENSK"] = {latitude = 44.766389,longitude = 39.887500},
		["BELORECHENSKII"] = {latitude = 43.911111,longitude = 42.787778},
		["BELOZERNYI"] = {latitude = 45.058611,longitude = 38.681944},
		["BELYI"] = {latitude = 45.165556,longitude = 37.275278},
		["BELYIUGOL'"] = {latitude = 44.021944,longitude = 42.834167},
		["BEREZOVYI"] = {latitude = 45.143889,longitude = 38.998333},
		["BESHALUBA"] = {latitude = 42.757778,longitude = 41.532778},
		["BESLENEI"] = {latitude = 44.243611,longitude = 41.761111},
		["BESLETI"] = {latitude = 43.013333,longitude = 41.051111},
		["BESSTRASHNAYA"] = {latitude = 44.251944,longitude = 41.162500},
		["BETLEMI"] = {latitude = 42.380278,longitude = 42.224722},
		["BEZYMYANNOE"] = {latitude = 44.549444,longitude = 39.136667},
		["BGARDVANY"] = {latitude = 43.203889,longitude = 40.613889},
		["BIA"] = {latitude = 42.344444,longitude = 41.939167},
		["BIGA"] = {latitude = 42.277222,longitude = 43.149444},
		["BLAGOVESCHENSKAYA"] = {latitude = 45.051667,longitude = 37.132778},
		["BOBOKVATI"] = {latitude = 41.779167,longitude = 41.823611},
		["BOBOTI"] = {latitude = 42.402222,longitude = 42.375278},
		["BOHVAURI"] = {latitude = 41.915000,longitude = 42.076111},
		["BOL'SHESIDOROVSKOE"] = {latitude = 45.032500,longitude = 39.848333},
		["BOL'SHIEHUTORA"] = {latitude = 44.743611,longitude = 37.606111},
		["BOL.RAZNOKOL"] = {latitude = 45.141389,longitude = 37.466389},
		["BOLGOV"] = {latitude = 45.229722,longitude = 39.908333},
		["BONCHKOVSKII"] = {latitude = 44.892778,longitude = 38.765556},
		["BORGUSTANSKAYA"] = {latitude = 44.053889,longitude = 42.560000},
		["BORI"] = {latitude = 42.053333,longitude = 43.143333},
		["BORISOVKA"] = {latitude = 44.753056,longitude = 37.701389},
		["BORITI"] = {latitude = 42.118889,longitude = 43.296944},
		["BOSELA"] = {latitude = 42.234722,longitude = 42.989722},
		["BOSTANA"] = {latitude = 42.546389,longitude = 43.103889},
		["BRATSKII"] = {latitude = 45.228611,longitude = 39.967778},
		["BUGEULI"] = {latitude = 42.533333,longitude = 43.083056},
		["BUKISTSIHE"] = {latitude = 42.002500,longitude = 42.312500},
		["BUKNARI"] = {latitude = 41.998333,longitude = 42.186667},
		["BULISHI"] = {latitude = 42.249167,longitude = 41.980556},
		["BULITSKU"] = {latitude = 42.351667,longitude = 41.900833},
		["BURNATI"] = {latitude = 42.031111,longitude = 42.316667},
		["BYNTHVA"] = {latitude = 43.158889,longitude = 40.753611},
		["BZHEDUHOVSKAYA"] = {latitude = 44.838333,longitude = 39.695000},
		["BZHOLIETI"] = {latitude = 41.959167,longitude = 42.266944},
		["BZYB'"] = {latitude = 43.230000,longitude = 40.375278},
		["BZYBTA3-IKM"] = {latitude = 43.271111,longitude = 40.408611},
		["BZYBTA5-IKM"] = {latitude = 43.285556,longitude = 40.411667},
		["CHABANLUG"] = {latitude = 43.106944,longitude = 40.812778},
		["CHACHIETI"] = {latitude = 41.952778,longitude = 42.230000},
		["CHAGAN-TSKVISHI"] = {latitude = 42.120556,longitude = 42.436667},
		["CHAGANI"] = {latitude = 42.226111,longitude = 42.399444},
		["CHAISUBANI"] = {latitude = 41.700556,longitude = 41.791667},
		["CHAKVA"] = {latitude = 41.727778,longitude = 41.747778},
		["CHAKVINDZHI"] = {latitude = 42.488333,longitude = 41.998611},
		["CHALA"] = {latitude = 42.928611,longitude = 41.281944},
		["CHALASTAVI"] = {latitude = 42.244722,longitude = 42.833333},
		["CHALATKE"] = {latitude = 42.143889,longitude = 43.051111},
		["CHALE"] = {latitude = 42.700833,longitude = 42.040000},
		["CHANCHATI"] = {latitude = 42.030833,longitude = 42.133333},
		["CHARNALI"] = {latitude = 41.570833,longitude = 41.635278},
		["CHEKON"] = {latitude = 45.103611,longitude = 37.513889},
		["CHEMBURKA"] = {latitude = 44.925833,longitude = 37.347500},
		["CHEMITOKVADZE"] = {latitude = 43.838889,longitude = 39.428611},
		["CHERESHNYA"] = {latitude = 43.445000,longitude = 39.994722},
		["CHERNIGOVKA"] = {latitude = 43.015000,longitude = 41.181944},
		["CHERNIGOVSKAYA"] = {latitude = 44.701111,longitude = 39.679722},
		["CHERNIGOVSKOE"] = {latitude = 44.251944,longitude = 39.776667},
		["CHERNOMORSKAYA"] = {latitude = 44.699444,longitude = 39.373889},
		["CHERNOMORSKII"] = {latitude = 44.848056,longitude = 38.500556},
		["CHERNYSHOV"] = {latitude = 45.048889,longitude = 40.048611},
		["CHHARETSERI"] = {latitude = 42.210833,longitude = 42.976111},
		["CHHARI"] = {latitude = 42.248056,longitude = 43.008333},
		["CHHENISHI"] = {latitude = 42.230278,longitude = 42.338333},
		["CHHORIA"] = {latitude = 42.604722,longitude = 41.975278},
		["CHHOROTSKU"] = {latitude = 42.519444,longitude = 42.152222},
		["CHHORTOLI"] = {latitude = 42.760556,longitude = 41.754444},
		["CHHOUSHI"] = {latitude = 42.435556,longitude = 41.803611},
		["CHHUTELI"] = {latitude = 42.647500,longitude = 42.814167},
		["CHIATURA"] = {latitude = 42.286944,longitude = 43.319444},
		["CHIGRINA"] = {latitude = 45.234444,longitude = 38.175833},
		["CHIHA"] = {latitude = 42.343333,longitude = 43.473056},
		["CHIHU"] = {latitude = 42.325000,longitude = 41.906944},
		["CHIORA"] = {latitude = 42.741944,longitude = 43.586389},
		["CHITATSKARI"] = {latitude = 42.474167,longitude = 41.872222},
		["CHKADUASHI"] = {latitude = 42.598333,longitude = 42.039167},
		["CHKONAGORA"] = {latitude = 42.087778,longitude = 42.160278},
		["CHKVALERI"] = {latitude = 42.718611,longitude = 42.110000},
		["CHKVISHI"] = {latitude = 42.122778,longitude = 42.456944},
		["CHLOU"] = {latitude = 42.872500,longitude = 41.508889},
		["CHOCHHATI"] = {latitude = 42.030556,longitude = 41.898889},
		["CHOGNARI"] = {latitude = 42.085833,longitude = 42.304722},
		["CHOHATAURI"] = {latitude = 42.018889,longitude = 42.268889},
		["CHOLABARGI"] = {latitude = 42.086944,longitude = 42.141667},
		["CHOMETI"] = {latitude = 42.039722,longitude = 42.374722},
		["CHORDZHO-DIDI"] = {latitude = 42.558889,longitude = 43.081944},
		["CHORVILA"] = {latitude = 42.279167,longitude = 43.446667},
		["CHRDILI"] = {latitude = 41.967500,longitude = 43.415278},
		["CHREBALO"] = {latitude = 42.567778,longitude = 42.992222},
		["CHUBURHINDZHI"] = {latitude = 42.582778,longitude = 41.828056},
		["CHUKULI"] = {latitude = 42.808056,longitude = 43.045000},
		["CHUNESHI"] = {latitude = 42.354444,longitude = 42.590833},
		["CHVELE"] = {latitude = 42.681667,longitude = 42.003889},
		["DABADZVELI"] = {latitude = 42.324444,longitude = 42.948889},
		["DABALI-ETSERI"] = {latitude = 41.968056,longitude = 42.186389},
		["DABLA-GOMI"] = {latitude = 42.092222,longitude = 42.407222},
		["DABLATSIHE"] = {latitude = 42.009444,longitude = 42.293056},
		["DACHA"] = {latitude = 42.833889,longitude = 41.228056},
		["DAGESTANSKAYA"] = {latitude = 44.376667,longitude = 40.033056},
		["DAGOMYS"] = {latitude = 43.661389,longitude = 39.668056},
		["DAHOVSKAYA"] = {latitude = 44.229444,longitude = 40.215833},
		["DAMANKA"] = {latitude = 44.966389,longitude = 37.793889},
		["DAPNARI"] = {latitude = 42.102778,longitude = 42.357778},
		["DARCHELI"] = {latitude = 42.440000,longitude = 41.709722},
		["DARKVETI"] = {latitude = 42.311944,longitude = 43.325000},
		["DAUSUZ"] = {latitude = 43.799167,longitude = 41.571389},
		["DAVITIANI"] = {latitude = 42.457778,longitude = 41.800000},
		["DEDALAURI"] = {latitude = 42.354444,longitude = 42.541111},
		["DEFANOVKA"] = {latitude = 44.429444,longitude = 38.792778},
		["DEHVIRI"] = {latitude = 42.623333,longitude = 42.796389},
		["DEISI"] = {latitude = 41.962778,longitude = 43.378611},
		["DELTASUBANI"] = {latitude = 42.233889,longitude = 43.079444},
		["DERBENTSKAYA"] = {latitude = 44.765000,longitude = 38.511389},
		["DERCHI"] = {latitude = 42.466389,longitude = 42.796944},
		["DGNORISA"] = {latitude = 42.466944,longitude = 42.841667},
		["DGVABA"] = {latitude = 42.345278,longitude = 41.751389},
		["DIDI-CHKONI"] = {latitude = 42.493056,longitude = 42.334722},
		["DIDI-DZHIHAISHI"] = {latitude = 42.233333,longitude = 42.461111},
		["DIDI-GANTIADI"] = {latitude = 42.093333,longitude = 43.209722},
		["DIDI-GUBI"] = {latitude = 42.270278,longitude = 42.487222},
		["DIDI-HORSHI"] = {latitude = 42.341111,longitude = 42.104167},
		["DIDI-KUHI"] = {latitude = 42.290278,longitude = 42.475556},
		["DIDI-NEDZI"] = {latitude = 42.401111,longitude = 41.720000},
		["DIDI-NEDZIS-KAHATI"] = {latitude = 42.428333,longitude = 41.740556},
		["DIDI-OPETI"] = {latitude = 42.065556,longitude = 42.390556},
		["DIDVELA"] = {latitude = 42.125000,longitude = 42.796667},
		["DIHASHHO"] = {latitude = 42.070000,longitude = 42.586111},
		["DIHAZURGA"] = {latitude = 42.608333,longitude = 41.877778},
		["DILIKAURI"] = {latitude = 42.150556,longitude = 43.132500},
		["DIMI"] = {latitude = 42.102500,longitude = 42.838333},
		["DINSKAYA"] = {latitude = 45.209444,longitude = 39.239167},
		["DIVNOMORSKOE"] = {latitude = 44.500556,longitude = 38.139722},
		["DOLGOGUSEVSKII"] = {latitude = 44.809444,longitude = 39.795833},
		["DOSHAKE"] = {latitude = 42.520278,longitude = 42.271111},
		["DRANDA"] = {latitude = 42.872778,longitude = 41.163611},
		["DRUZHBA"] = {latitude = 44.201667,longitude = 42.039444},
		["DRUZHELYUBNYI"] = {latitude = 45.122778,longitude = 39.169722},
		["DRUZHNYI"] = {latitude = 44.729444,longitude = 39.787778},
		["DUKMASOV"] = {latitude = 45.005000,longitude = 39.926389},
		["DURGENA"] = {latitude = 42.243333,longitude = 41.960556},
		["DURIPSH"] = {latitude = 43.208333,longitude = 40.640556},
		["DUTSHUNI"] = {latitude = 42.012778,longitude = 42.493056},
		["DVABZU"] = {latitude = 41.937222,longitude = 42.079444},
		["DZEDZILETI"] = {latitude = 42.420556,longitude = 42.583333},
		["DZHAGA"] = {latitude = 43.954444,longitude = 42.586667},
		["DZHAGIRA"] = {latitude = 42.539167,longitude = 42.077778},
		["DZHAHUNDERI"] = {latitude = 42.798056,longitude = 43.049722},
		["DZHALAURTA"] = {latitude = 42.243889,longitude = 43.417778},
		["DZHAMBICHI"] = {latitude = 45.083333,longitude = 39.868056},
		["DZHAPANA"] = {latitude = 42.095278,longitude = 42.213611},
		["DZHAPSHAKARI"] = {latitude = 42.411944,longitude = 41.998611},
		["DZHEGUTA"] = {latitude = 43.966111,longitude = 42.065556},
		["DZHEROKAI"] = {latitude = 44.988333,longitude = 40.325000},
		["DZHGALI"] = {latitude = 42.653333,longitude = 42.149722},
		["DZHGERDA"] = {latitude = 42.910000,longitude = 41.379722},
		["DZHGYDYRHVA"] = {latitude = 43.180278,longitude = 40.717222},
		["DZHIDZHIHABL'"] = {latitude = 44.946389,longitude = 39.417500},
		["DZHIGINKA"] = {latitude = 45.127500,longitude = 37.341667},
		["DZHIHA"] = {latitude = 42.358333,longitude = 42.230000},
		["DZHIHASKARI"] = {latitude = 42.510833,longitude = 42.039167},
		["DZHIMOSTARO"] = {latitude = 42.300000,longitude = 42.731667},
		["DZHINGIRIK"] = {latitude = 43.734444,longitude = 41.909444},
		["DZHIRHVA"] = {latitude = 43.206667,longitude = 40.563333},
		["DZHOLEVI"] = {latitude = 42.372222,longitude = 42.270278},
		["DZHUBGA"] = {latitude = 44.322778,longitude = 38.713611},
		["DZHUKMUR"] = {latitude = 42.745556,longitude = 41.466944},
		["DZHUMI"] = {latitude = 42.451389,longitude = 41.893889},
		["DZHUMITI1-E"] = {latitude = 42.550833,longitude = 41.893889},
		["DZHUMITI2-E"] = {latitude = 42.578056,longitude = 42.157500},
		["DZHUNETSERI"] = {latitude = 42.071111,longitude = 42.020278},
		["DZHURUKVETI"] = {latitude = 42.076389,longitude = 41.939722},
		["DZHVARI"] = {latitude = 42.702222,longitude = 42.070833},
		["DZHVARISA"] = {latitude = 42.380000,longitude = 42.840000},
		["DZIGURI"] = {latitude = 42.236667,longitude = 42.167778},
		["DZIGUTA"] = {latitude = 43.008056,longitude = 41.072222},
		["DZIRIDZHUMATI"] = {latitude = 42.016111,longitude = 41.992222},
		["DZIROVANI"] = {latitude = 42.349167,longitude = 42.970833},
		["DZLOUR-DANETI"] = {latitude = 42.074722,longitude = 43.055000},
		["DZMUISI"] = {latitude = 42.426389,longitude = 42.941944},
		["DZUKNURI"] = {latitude = 42.320278,longitude = 42.911389},
		["DZULUHI"] = {latitude = 42.026111,longitude = 42.639722},
		["DZVELI-ABASHA"] = {latitude = 42.240000,longitude = 42.230833},
		["DZVELI-HIBULA"] = {latitude = 42.450278,longitude = 41.958333},
		["DZVELI-SENAKI"] = {latitude = 42.295000,longitude = 42.150833},
		["DZVERI"] = {latitude = 42.239167,longitude = 42.962778},
		["EKATERINOVSKII"] = {latitude = 45.086111,longitude = 38.495278},
		["EKONOMICHESKOE"] = {latitude = 44.988889,longitude = 37.947222},
		["EL'BRUS"] = {latitude = 43.253889,longitude = 42.670000},
		["EL'BRUSSKII"] = {latitude = 43.566667,longitude = 42.158889},
		["EL'BURGAN"] = {latitude = 44.077500,longitude = 41.817500},
		["EL'TARKACH"] = {latitude = 43.980000,longitude = 42.153333},
		["ELENOVSKOE"] = {latitude = 45.097500,longitude = 39.719167},
		["ELIZAVETINSKAYA"] = {latitude = 45.043333,longitude = 38.806944},
		["ENEM"] = {latitude = 44.924444,longitude = 38.915833},
		["ERGE"] = {latitude = 41.563056,longitude = 41.709167},
		["ERGETA"] = {latitude = 42.385556,longitude = 41.693611},
		["ERIK"] = {latitude = 44.584167,longitude = 39.714444},
		["ERIVANSKAYA"] = {latitude = 44.723056,longitude = 38.189722},
		["ESHERA"] = {latitude = 43.039167,longitude = 40.944444},
		["ESSENTUKI"] = {latitude = 44.045278,longitude = 42.892778},
		["ESSENTUKSKAYA"] = {latitude = 44.027500,longitude = 42.899444},
		["ESTO-SADOK"] = {latitude = 43.687222,longitude = 40.271667},
		["ESTONKA"] = {latitude = 42.887500,longitude = 41.216944},
		["ETSERDZVELI-SAMTREDIA"] = {latitude = 42.166389,longitude = 42.391389},
		["ETSERI"] = {latitude = 42.210833,longitude = 42.953056},
		["EVSEEVSKII"] = {latitude = 45.045278,longitude = 38.156111},
		["EZHEDUGHABL'"] = {latitude = 44.974444,longitude = 39.716389},
		["FADEEVO"] = {latitude = 45.062222,longitude = 37.557500},
		["FADEEVSKII"] = {latitude = 44.639167,longitude = 39.880833},
		["FEDOROVSKAYA"] = {latitude = 45.072500,longitude = 38.468333},
		["FERIA"] = {latitude = 41.633056,longitude = 41.670556},
		["FONTALOVSKAYA"] = {latitude = 45.358056,longitude = 35.937778},
		["GADIDI"] = {latitude = 42.030556,longitude = 42.543056},
		["GAGMAKARIATA"] = {latitude = 42.263889,longitude = 41.780000},
		["GAGMA-BOSLEVI"] = {latitude = 42.184444,longitude = 43.196111},
		["GAGMA-DVABZU"] = {latitude = 41.950556,longitude = 42.092222},
		["GAGMA-PIRVELI-HORGA"] = {latitude = 42.269167,longitude = 41.878056},
		["GAGMA-SADZHIDZHAO"] = {latitude = 42.364722,longitude = 42.058333},
		["GAGMA-SHUA-HORGA"] = {latitude = 42.258889,longitude = 41.834444},
		["GAGMA-VANI"] = {latitude = 42.070556,longitude = 42.515833},
		["GAGMA-ZANATI"] = {latitude = 42.223333,longitude = 42.135556},
		["GAGRA"] = {latitude = 43.300833,longitude = 40.274167},
		["GAGULECHI"] = {latitude = 42.613056,longitude = 42.859722},
		["GAHOMELA"] = {latitude = 42.347500,longitude = 42.211667},
		["GAI-KODZOR"] = {latitude = 44.851389,longitude = 37.443889},
		["GAIDUK"] = {latitude = 44.783611,longitude = 37.706944},
		["GALI"] = {latitude = 42.626389,longitude = 41.755278},
		["GAMOGMAKARIATA"] = {latitude = 42.273889,longitude = 41.766667},
		["GAMOGMA-KODORI"] = {latitude = 42.182778,longitude = 42.192500},
		["GAMOGMA-PIRVELI-HORGA"] = {latitude = 42.281667,longitude = 41.864444},
		["GAMOGMA-SHUA-HORGA"] = {latitude = 42.267778,longitude = 41.815833},
		["GAMOGMA-ZANATI"] = {latitude = 42.215278,longitude = 42.153333},
		["GANAHLEBA"] = {latitude = 42.929167,longitude = 41.293889},
		["GANARDZHIIS-MUHURI"] = {latitude = 42.427222,longitude = 41.651944},
		["GANATLEBISKARI"] = {latitude = 42.221667,longitude = 42.209167},
		["GANIRI"] = {latitude = 42.240556,longitude = 42.375833},
		["GANTIADI"] = {latitude = 43.393611,longitude = 40.101389},
		["GANTIADI"] = {latitude = 42.040278,longitude = 42.410278},
		["GARAHA"] = {latitude = 42.516111,longitude = 42.178889},
		["GARIHEVI"] = {latitude = 42.032778,longitude = 43.259722},
		["GARKUSHA"] = {latitude = 45.314167,longitude = 36.856111},
		["GARP"] = {latitude = 43.238889,longitude = 40.562222},
		["GATLUKAI"] = {latitude = 44.888889,longitude = 39.245000},
		["GAUTSKINARI"] = {latitude = 42.126667,longitude = 42.294722},
		["GAVERDOVSKII"] = {latitude = 44.612778,longitude = 40.036111},
		["GEBI"] = {latitude = 42.765000,longitude = 43.539444},
		["GEDZHETI"] = {latitude = 42.299167,longitude = 42.208611},
		["GEGUTI"] = {latitude = 42.169722,longitude = 42.698056},
		["GELATI"] = {latitude = 42.296944,longitude = 42.787778},
		["GELENDZHIK"] = {latitude = 44.582778,longitude = 38.031111},
		["GEORGIEVSKOE"] = {latitude = 44.162778,longitude = 39.263611},
		["GEZATI"] = {latitude = 42.220278,longitude = 42.281944},
		["GIAGINSKAYA"] = {latitude = 44.870278,longitude = 40.067222},
		["GIMOZGONDZHILI"] = {latitude = 42.256667,longitude = 41.971111},
		["GLEBOVSKOE"] = {latitude = 44.706667,longitude = 37.647222},
		["GLOLA"] = {latitude = 42.699167,longitude = 43.680000},
		["GOCHA-DZHIHAISHI"] = {latitude = 42.257500,longitude = 42.426944},
		["GODOGANI"] = {latitude = 42.256667,longitude = 42.805833},
		["GOFITSKOE"] = {latitude = 44.250556,longitude = 40.991667},
		["GOGNI"] = {latitude = 42.275556,longitude = 43.014444},
		["GOGOLESUBANI"] = {latitude = 42.022778,longitude = 42.223056},
		["GOITH"] = {latitude = 44.244722,longitude = 39.387222},
		["GOLASKURI"] = {latitude = 42.237222,longitude = 41.997778},
		["GOLOVINKA"] = {latitude = 43.800000,longitude = 39.471944},
		["GOLUBEVADACHA"] = {latitude = 43.984167,longitude = 39.240000},
		["GOLUBITSKAYA"] = {latitude = 45.317222,longitude = 37.280833},
		["GOMI"] = {latitude = 41.887778,longitude = 42.128611},
		["GONA"] = {latitude = 42.331944,longitude = 43.540833},
		["GONCHARKA"] = {latitude = 44.806944,longitude = 39.968611},
		["GONEBISKARI"] = {latitude = 41.901944,longitude = 42.108333},
		["GONIO"] = {latitude = 41.563611,longitude = 41.584722},
		["GORABEREZHOULI"] = {latitude = 42.003333,longitude = 42.227222},
		["GORESHA"] = {latitude = 42.070556,longitude = 43.289444},
		["GORGADZEEBI"] = {latitude = 41.718056,longitude = 41.789722},
		["GORISA"] = {latitude = 42.289167,longitude = 43.441667},
		["GORMAGALI"] = {latitude = 42.050833,longitude = 42.346944},
		["GORNYI"] = {latitude = 44.279444,longitude = 39.285000},
		["GORYACHIIKLYUCH"] = {latitude = 44.627778,longitude = 39.136944},
		["GOSTAGAEVSKAYA"] = {latitude = 45.018056,longitude = 37.511944},
		["GREBESHOK"] = {latitude = 43.349167,longitude = 40.172500},
		["GREHILI-AVEDZHI"] = {latitude = 41.986111,longitude = 43.259722},
		["GRIGALATI"] = {latitude = 42.086667,longitude = 43.426667},
		["GRIGOLISHI"] = {latitude = 42.538333,longitude = 41.992500},
		["GRIGOR'EVSKAYA"] = {latitude = 44.770000,longitude = 38.849722},
		["GRMAGELE"] = {latitude = 42.028611,longitude = 41.849444},
		["GROZNEFT'"] = {latitude = 44.096111,longitude = 39.110278},
		["GROZNYI"] = {latitude = 44.555833,longitude = 40.146389},
		["GUBISTSKALI"] = {latitude = 42.303611,longitude = 42.542222},
		["GUBSKAYA"] = {latitude = 44.316389,longitude = 40.648056},
		["GUDAUTA"] = {latitude = 43.110000,longitude = 40.646944},
		["GUL'RIPSH"] = {latitude = 42.926944,longitude = 41.116667},
		["GULUHETI"] = {latitude = 42.239722,longitude = 42.295556},
		["GUMATI"] = {latitude = 42.337500,longitude = 42.701667},
		["GUMBRA"] = {latitude = 42.301111,longitude = 42.660833},
		["GUMISTA"] = {latitude = 43.027500,longitude = 40.961944},
		["GUNDAETI"] = {latitude = 42.236667,longitude = 43.355556},
		["GUPAGU"] = {latitude = 42.889722,longitude = 41.612778},
		["GURIANTA"] = {latitude = 41.950556,longitude = 41.948333},
		["GURIISKAYA"] = {latitude = 44.655833,longitude = 39.626111},
		["GURNA"] = {latitude = 42.401389,longitude = 42.880278},
		["GUTURI"] = {latitude = 42.003889,longitude = 42.262222},
		["GVANDRA"] = {latitude = 43.046944,longitude = 40.925556},
		["GVANKITI"] = {latitude = 42.164722,longitude = 43.011944},
		["GVARA"] = {latitude = 41.818056,longitude = 41.866111},
		["GVERKI"] = {latitude = 42.054722,longitude = 43.221667},
		["GVIMARONI"] = {latitude = 42.276111,longitude = 41.986667},
		["GVISHTIBI"] = {latitude = 42.310833,longitude = 42.595278},
		["GVITORI"] = {latitude = 42.290278,longitude = 43.212778},
		["GYURYUL'DEUK"] = {latitude = 43.982500,longitude = 42.086944},
		["H.IM.LENINA"] = {latitude = 45.020556,longitude = 39.228611},
		["HABEZ"] = {latitude = 44.040556,longitude = 41.788611},
		["HABUME"] = {latitude = 42.576389,longitude = 42.178056},
		["HACHEMZII"] = {latitude = 44.951111,longitude = 40.330833},
		["HADYZHENSK"] = {latitude = 44.426389,longitude = 39.545556},
		["HADZHIKO"] = {latitude = 44.007778,longitude = 39.345000},
		["HALIPAURI"] = {latitude = 42.340278,longitude = 43.331944},
		["HAMISKURI"] = {latitude = 42.388333,longitude = 41.826389},
		["HAMYSHKI"] = {latitude = 44.097222,longitude = 40.143056},
		["HAN'KOV"] = {latitude = 45.156667,longitude = 37.876944},
		["HANI"] = {latitude = 41.952778,longitude = 42.980833},
		["HANSKAYA"] = {latitude = 44.676111,longitude = 39.976111},
		["HANTSKI"] = {latitude = 42.576667,longitude = 42.244722},
		["HARISTVALA"] = {latitude = 42.410000,longitude = 43.071944},
		["HASAUT-GRECHESKOE"] = {latitude = 43.713333,longitude = 41.689444},
		["HATAZHUKAI"] = {latitude = 45.070278,longitude = 40.198611},
		["HATUKAI"] = {latitude = 45.186944,longitude = 39.675278},
		["HEIVANI"] = {latitude = 43.390000,longitude = 40.088889},
		["HELEDI"] = {latitude = 42.791111,longitude = 42.666667},
		["HELVACHAURI"] = {latitude = 41.594167,longitude = 41.680000},
		["HETA"] = {latitude = 42.355000,longitude = 41.877500},
		["HETSERA"] = {latitude = 42.430278,longitude = 41.899167},
		["HEVI"] = {latitude = 41.962778,longitude = 42.295833},
		["HIDARI"] = {latitude = 42.016389,longitude = 43.126667},
		["HIDISTAVI"] = {latitude = 41.964722,longitude = 42.209722},
		["HIDMAGALA"] = {latitude = 42.040556,longitude = 41.808056},
		["HIMSHI"] = {latitude = 42.524167,longitude = 43.219722},
		["HOBI"] = {latitude = 42.316111,longitude = 41.916944},
		["HOLE"] = {latitude = 42.627778,longitude = 41.853889},
		["HOLMSKII"] = {latitude = 44.843611,longitude = 38.400278},
		["HOLODNAYARECHKA"] = {latitude = 43.364167,longitude = 40.145278},
		["HOMULI"] = {latitude = 42.332778,longitude = 42.655000},
		["HONCHIORI"] = {latitude = 42.495278,longitude = 43.063333},
		["HONI"] = {latitude = 42.318333,longitude = 42.436667},
		["HORITI"] = {latitude = 42.069444,longitude = 43.236944},
		["HOSTA"] = {latitude = 43.518056,longitude = 39.880278},
		["HOTEVI"] = {latitude = 42.463889,longitude = 43.163333},
		["HREITI"] = {latitude = 42.344167,longitude = 43.206667},
		["HRESILI"] = {latitude = 42.345278,longitude = 42.915000},
		["HRIALETI"] = {latitude = 42.005000,longitude = 41.838889},
		["HUMARA"] = {latitude = 43.861389,longitude = 41.937778},
		["HUMENI-NATOPURI"] = {latitude = 42.625556,longitude = 41.628611},
		["HUNDZHULOURI"] = {latitude = 42.186944,longitude = 42.328333},
		["HUNEVI"] = {latitude = 42.100000,longitude = 43.390278},
		["HURZUK"] = {latitude = 43.431111,longitude = 42.175278},
		["HUSY-KARDONIK"] = {latitude = 43.786389,longitude = 41.593889},
		["HUTSUBANI"] = {latitude = 41.812778,longitude = 41.838333},
		["HVANCHKARA"] = {latitude = 42.561667,longitude = 43.047778},
		["IANETI"] = {latitude = 42.184444,longitude = 42.442222},
		["IANEULI"] = {latitude = 41.994444,longitude = 42.305278},
		["IL'ICH"] = {latitude = 45.424167,longitude = 36.773611},
		["IL'ICHEVSKOE"] = {latitude = 44.187778,longitude = 42.171389},
		["IL'SKII"] = {latitude = 44.843056,longitude = 38.578333},
		["IM.KOSTAHETAGUROVA"] = {latitude = 43.804444,longitude = 41.924722},
		["IM.TEL'MANA"] = {latitude = 44.073889,longitude = 42.885833},
		["IMERETINSKAYA"] = {latitude = 44.685278,longitude = 39.438611},
		["INASHAURI"] = {latitude = 42.058333,longitude = 42.658611},
		["INCHHURI"] = {latitude = 42.447500,longitude = 42.421111},
		["INDUSTRIAL'NYI"] = {latitude = 45.092778,longitude = 39.113056},
		["INDYUK"] = {latitude = 44.223889,longitude = 39.249722},
		["INGIRI"] = {latitude = 42.494722,longitude = 41.834167},
		["INGURGES"] = {latitude = 42.669167,longitude = 41.873889},
		["INKIT"] = {latitude = 43.179722,longitude = 40.309167},
		["INTABUETI"] = {latitude = 41.973056,longitude = 42.248889},
		["INZHI-CHISHKO"] = {latitude = 44.698889,longitude = 41.736667},
		["INZHICH-CHUKUN"] = {latitude = 44.045278,longitude = 41.804167},
		["IPNARI"] = {latitude = 43.238333,longitude = 40.318333},
		["IRTAVAZA"] = {latitude = 42.292500,longitude = 43.518333},
		["ISPRAVNAYA"] = {latitude = 44.070833,longitude = 41.627778},
		["ISRITI"] = {latitude = 42.057778,longitude = 42.613611},
		["ISULA"] = {latitude = 42.232778,longitude = 42.088611},
		["ISUNDERI"] = {latitude = 42.553333,longitude = 42.677222},
		["ITHVISI"] = {latitude = 42.295000,longitude = 43.374444},
		["IVANDIDI"] = {latitude = 42.296389,longitude = 42.445000},
		["IVANOV"] = {latitude = 45.110000,longitude = 37.458889},
		["IVANOVSKAYA"] = {latitude = 45.271944,longitude = 38.471944},
		["IZMAILOVKA"] = {latitude = 43.632500,longitude = 39.834722},
		["IZUMRUD"] = {latitude = 43.468056,longitude = 39.970278},
		["KABARDINKA"] = {latitude = 44.651667,longitude = 37.944167},
		["KABARDINSKAYA"] = {latitude = 44.497778,longitude = 39.503611},
		["KABEHABL'"] = {latitude = 45.043889,longitude = 40.192778},
		["KACHAETI"] = {latitude = 42.471944,longitude = 43.135556},
		["KAHATI"] = {latitude = 42.490556,longitude = 41.786389},
		["KAKUTI"] = {latitude = 41.858333,longitude = 41.991389},
		["KALADZHINSKAYA"] = {latitude = 44.309444,longitude = 40.924444},
		["KALDAHVARA"] = {latitude = 43.224444,longitude = 40.435000},
		["KALEZH"] = {latitude = 44.008056,longitude = 39.366667},
		["KALININA"] = {latitude = 44.501667,longitude = 39.733333},
		["KALININO"] = {latitude = 45.099444,longitude = 39.026389},
		["KALININSKII"] = {latitude = 45.199722,longitude = 40.060833},
		["KALINOVOEOZERO"] = {latitude = 43.615556,longitude = 39.896944},
		["KALUZHSKAYA"] = {latitude = 44.761667,longitude = 38.986389},
		["KAMENNOMOSTSKII"] = {latitude = 44.298056,longitude = 40.195556},
		["KAMENNOMOSTSKII "] = {latitude = 43.748611,longitude = 41.932222},
		["KARACHAEVSK"] = {latitude = 43.768333,longitude = 41.920833},
		["KARDONIKSKAYA"] = {latitude = 43.863333,longitude = 41.738056},
		["KARLAMARKSA"] = {latitude = 45.239722,longitude = 39.073889},
		["KARSKII"] = {latitude = 44.824167,longitude = 38.521944},
		["KATSHI"] = {latitude = 42.288056,longitude = 43.235556},
		["KAZAZOV"] = {latitude = 44.901944,longitude = 39.185556},
		["KELASURI"] = {latitude = 43.025000,longitude = 41.124167},
		["KELERMESSKAYA"] = {latitude = 44.789167,longitude = 40.141667},
		["KEMAL'PASHA"] = {latitude = 41.469722,longitude = 41.532778},
		["KERKEN"] = {latitude = 42.875833,longitude = 41.472500},
		["KESLEROVO"] = {latitude = 45.058333,longitude = 37.827222},
		["KETILARI"] = {latitude = 42.145000,longitude = 42.189722},
		["KICHI-BALYK"] = {latitude = 43.790556,longitude = 42.679444},
		["KIEVSKOE"] = {latitude = 45.031667,longitude = 37.896944},
		["KIRILOVKA"] = {latitude = 44.766667,longitude = 37.731667},
		["KIROV"] = {latitude = 42.414722,longitude = 41.679722},
		["KIRPICHNOE"] = {latitude = 44.168333,longitude = 39.210556},
		["KIRPICHNYI"] = {latitude = 44.040556,longitude = 42.859444},
		["KIRTSHI"] = {latitude = 42.485000,longitude = 42.075833},
		["KISLOVODSK"] = {latitude = 43.914722,longitude = 42.750833},
		["KITSHI"] = {latitude = 42.033056,longitude = 43.148889},
		["KOBU-BASHI"] = {latitude = 43.930833,longitude = 41.331667},
		["KOBULETI"] = {latitude = 41.815278,longitude = 41.795556},
		["KOCHARA"] = {latitude = 42.856111,longitude = 41.462222},
		["KOCHETINSKII"] = {latitude = 45.172500,longitude = 39.248889},
		["KOHNARI"] = {latitude = 42.033889,longitude = 42.335000},
		["KOIDAN"] = {latitude = 44.105278,longitude = 42.184444},
		["KOKA"] = {latitude = 42.314444,longitude = 42.853611},
		["KOKI"] = {latitude = 42.478056,longitude = 41.724722},
		["KOLHIDA"] = {latitude = 43.248889,longitude = 40.309444},
		["KOLOBANI"] = {latitude = 42.199167,longitude = 42.291389},
		["KOLOS"] = {latitude = 45.146111,longitude = 38.353611},
		["KOLOSISTYI"] = {latitude = 45.129444,longitude = 38.909444},
		["KOMSOMOL'SKII"] = {latitude = 44.933333,longitude = 39.715278},
		["KONCHKATI"] = {latitude = 41.984722,longitude = 41.916389},
		["KONTIANETI"] = {latitude = 42.324722,longitude = 42.191944},
		["KONTUATI"] = {latitude = 42.347778,longitude = 42.440278},
		["KOPANSKII"] = {latitude = 45.170000,longitude = 38.813333},
		["KORASI"] = {latitude = 42.858889,longitude = 41.169722},
		["KORATI"] = {latitude = 42.244167,longitude = 41.818611},
		["KORBOULI"] = {latitude = 42.234722,longitude = 43.496667},
		["KORETI"] = {latitude = 42.297222,longitude = 43.409444},
		["KORTSHELI"] = {latitude = 42.560278,longitude = 41.967778},
		["KORZHEVSKII"] = {latitude = 45.190833,longitude = 37.723333},
		["KOSH-HABL'"] = {latitude = 44.141111,longitude = 41.872222},
		["KOSOVICHI"] = {latitude = 45.084722,longitude = 38.570833},
		["KOZET"] = {latitude = 44.992222,longitude = 39.009722},
		["KRAEVSKO-ARMYANSKOE"] = {latitude = 43.601667,longitude = 39.834722},
		["KRASN.KURGAN"] = {latitude = 43.943889,longitude = 42.635000},
		["KRASNAYABATAREYA"] = {latitude = 45.083333,longitude = 37.793889},
		["KRASNAYAPOLYANA"] = {latitude = 43.683056,longitude = 40.217222},
		["KRASNAYAVOLYA"] = {latitude = 43.561389,longitude = 39.931667},
		["KRASNODAR"] = {latitude = 45.040556,longitude = 38.998056},
		["KRASNODARSKII"] = {latitude = 45.150556,longitude = 39.144722},
		["KRASNOGORSKAYA"] = {latitude = 43.932778,longitude = 41.915556},
		["KRASNOGVARDEISKOE"] = {latitude = 45.121944,longitude = 39.580000},
		["KRASNOOKTYABR'SKII"] = {latitude = 44.929444,longitude = 38.377222},
		["KRASNOSEL'SKOE"] = {latitude = 45.287778,longitude = 39.173611},
		["KRASNOVOSTOCHNYI"] = {latitude = 43.965556,longitude = 42.326111},
		["KRASNYI"] = {latitude = 44.939722,longitude = 37.348333},
		["KRASNYIKURGAN"] = {latitude = 45.010278,longitude = 37.346389},
		["KRASNYIOKTYABR'"] = {latitude = 45.189444,longitude = 37.665000},
		["KREPOSTNAYA"] = {latitude = 44.708889,longitude = 38.688611},
		["KRIKUNA"] = {latitude = 45.260556,longitude = 38.218889},
		["KRIVENKOVSKOE"] = {latitude = 44.190000,longitude = 39.245000},
		["KRIZHANOVSKII"] = {latitude = 45.244444,longitude = 38.173056},
		["KROYANSKOE"] = {latitude = 44.093889,longitude = 39.131667},
		["KRYMSK"] = {latitude = 44.921389,longitude = 38.003056},
		["KUBANSKAYA"] = {latitude = 44.605556,longitude = 39.725000},
		["KUBANSKII"] = {latitude = 44.615000,longitude = 39.789722},
		["KUBINA"] = {latitude = 44.059444,longitude = 41.973889},
		["KUCHUGURY"] = {latitude = 45.397500,longitude = 36.964722},
		["KUDEPSTA"] = {latitude = 43.499444,longitude = 39.904722},
		["KUHESHI"] = {latitude = 42.678889,longitude = 42.139167},
		["KUL'TUBANI"] = {latitude = 43.413056,longitude = 40.031667},
		["KULASHI"] = {latitude = 42.207500,longitude = 42.371389},
		["KULEVI"] = {latitude = 42.271111,longitude = 41.675556},
		["KULISHKARI"] = {latitude = 42.509167,longitude = 41.980000},
		["KUMISTAVI"] = {latitude = 42.382222,longitude = 42.612500},
		["KUMURI"] = {latitude = 42.032778,longitude = 42.486389},
		["KUMYSH"] = {latitude = 43.882222,longitude = 41.917778},
		["KUNCHUKOHABL'"] = {latitude = 44.981111,longitude = 39.484722},
		["KUR.BAHMARO"] = {latitude = 41.847222,longitude = 42.349444},
		["KUR.SAIRME"] = {latitude = 41.904167,longitude = 42.765833},
		["KUR.SKURI"] = {latitude = 42.693056,longitude = 42.182778},
		["KURCHANSKAYA"] = {latitude = 45.219167,longitude = 37.574722},
		["KURDZHINOVO"] = {latitude = 44.018889,longitude = 40.960278},
		["KURDZHIPSKAYA"] = {latitude = 44.463889,longitude = 40.070000},
		["KURINSKAYA"] = {latitude = 44.413333,longitude = 39.423889},
		["KURSEBI"] = {latitude = 42.321667,longitude = 42.807222},
		["KURZU"] = {latitude = 42.585278,longitude = 42.311944},
		["KUSHUBAURI"] = {latitude = 42.048889,longitude = 42.463889},
		["KUTAIS"] = {latitude = 44.519167,longitude = 39.305833},
		["KUTAISI"] = {latitude = 42.258889,longitude = 42.716389},
		["KUTAISSKAYA"] = {latitude = 44.645000,longitude = 39.322222},
		["KUTIRI"] = {latitude = 42.258889,longitude = 42.377500},
		["KUTOL"] = {latitude = 42.846944,longitude = 41.402222},
		["KUTYSHHA"] = {latitude = 43.022500,longitude = 40.951111},
		["KUZHORSKAYA"] = {latitude = 44.670000,longitude = 40.319167},
		["KVABGA"] = {latitude = 41.921389,longitude = 42.420833},
		["KVABRYUTA"] = {latitude = 43.191944,longitude = 40.742222},
		["KVACHALATI"] = {latitude = 41.896111,longitude = 42.042222},
		["KVAHCHIRI"] = {latitude = 42.203056,longitude = 42.762222},
		["KVAITI"] = {latitude = 42.424444,longitude = 42.440833},
		["KVAKUDE"] = {latitude = 42.051944,longitude = 42.321389},
		["KVASHHIETI"] = {latitude = 42.543889,longitude = 43.414722},
		["KVATSHUTI"] = {latitude = 42.530556,longitude = 43.200278},
		["KVATSIHE"] = {latitude = 42.285556,longitude = 43.173056},
		["KVEBI"] = {latitude = 41.959722,longitude = 43.358611},
		["KVEDA"] = {latitude = 41.797500,longitude = 41.851944},
		["KVEDA-DZIMITI"] = {latitude = 41.992500,longitude = 42.075833},
		["KVEDA-ACHKVA"] = {latitude = 41.734444,longitude = 41.792222},
		["KVEDA-ALISUBANI"] = {latitude = 42.236944,longitude = 43.116111},
		["KVEDA-BAHVI"] = {latitude = 41.960278,longitude = 42.111111},
		["KVEDA-BERETISA"] = {latitude = 42.185556,longitude = 43.415556},
		["KVEDA-BZVANI"] = {latitude = 42.074167,longitude = 42.613056},
		["KVEDA-CHELOVANI"] = {latitude = 42.356111,longitude = 43.304167},
		["KVEDA-CHHOROTSKU"] = {latitude = 42.495278,longitude = 42.126389},
		["KVEDA-CHKVISHI"] = {latitude = 42.560556,longitude = 42.967222},
		["KVEDA-GORA"] = {latitude = 42.069722,longitude = 42.688333},
		["KVEDA-GORDI"] = {latitude = 42.440000,longitude = 42.545833},
		["KVEDA-GVIRISHI"] = {latitude = 42.576667,longitude = 42.826389},
		["KVEDA-ILEMI"] = {latitude = 42.071667,longitude = 43.155278},
		["KVEDA-KINCHHA"] = {latitude = 42.485278,longitude = 42.583056},
		["KVEDA-KVALITI"] = {latitude = 42.090000,longitude = 43.018611},
		["KVEDA-KVIRIKE"] = {latitude = 41.774167,longitude = 41.849167},
		["KVEDA-LUHVANO"] = {latitude = 42.633611,longitude = 42.751389},
		["KVEDA-MAMATI"] = {latitude = 42.023333,longitude = 42.025000},
		["KVEDA-MESHETI"] = {latitude = 42.210556,longitude = 42.650000},
		["KVEDA-MUKEDI"] = {latitude = 42.077222,longitude = 42.485278},
		["KVEDA-SAKARA"] = {latitude = 42.132500,longitude = 43.056111},
		["KVEDA-SAZANO"] = {latitude = 42.189444,longitude = 43.091667},
		["KVEDA-SIMONETI"] = {latitude = 42.221111,longitude = 42.885278},
		["KVEDA-TLUGI"] = {latitude = 42.446667,longitude = 43.159444},
		["KVEDA-TSAGERI"] = {latitude = 42.633889,longitude = 42.778333},
		["KVEDA-TSEVA"] = {latitude = 42.095556,longitude = 43.163056},
		["KVEDA-TSIHESULORI"] = {latitude = 42.091667,longitude = 42.491944},
		["KVEDA-ZEGANI"] = {latitude = 42.050833,longitude = 42.906111},
		["KVEDO-NASAKIRALI"] = {latitude = 41.975833,longitude = 42.078333},
		["KVEMO-"] = {latitude = 42.530556,longitude = 43.305833},
		["KVEMO-ABASHA"] = {latitude = 42.065556,longitude = 42.354444},
		["KVEMO-AKETI"] = {latitude = 42.016389,longitude = 42.102778},
		["KVEMO-BARGEBI"] = {latitude = 42.554444,longitude = 41.619722},
		["KVEMO-BIRTSHA"] = {latitude = 43.026111,longitude = 41.069444},
		["KVEMO-CHIBATI"] = {latitude = 42.085278,longitude = 42.003056},
		["KVEMO-GUMURISHI"] = {latitude = 42.696389,longitude = 41.798889},
		["KVEMO-HETI"] = {latitude = 42.033333,longitude = 42.361111},
		["KVEMO-HUNTSI"] = {latitude = 42.387222,longitude = 42.429722},
		["KVEMO-LINDA"] = {latitude = 43.053056,longitude = 41.101667},
		["KVEMO-MAKVANETI"] = {latitude = 41.898333,longitude = 42.021944},
		["KVEMO-MERHEULI"] = {latitude = 42.954444,longitude = 41.098889},
		["KVEMO-NAGVAZAVO"] = {latitude = 42.367500,longitude = 42.374444},
		["KVEMO-NATANEBI"] = {latitude = 41.940000,longitude = 41.837222},
		["KVEMO-SHUHUTI"] = {latitude = 42.075556,longitude = 42.093611},
		["KVENOBANI"] = {latitude = 41.985833,longitude = 42.195833},
		["KVIANI"] = {latitude = 42.089722,longitude = 42.187778},
		["KVILISHORI"] = {latitude = 42.365278,longitude = 42.656667},
		["KVIRIKE"] = {latitude = 42.221667,longitude = 42.366111},
		["KVISHARI"] = {latitude = 42.553056,longitude = 42.971111},
		["KVISHONA"] = {latitude = 42.483611,longitude = 41.623056},
		["KVITIRI"] = {latitude = 42.236111,longitude = 42.658333},
		["KYZYL-KALA"] = {latitude = 43.914722,longitude = 42.045278},
		["KYZYL-OKTYABR'SKII"] = {latitude = 43.820278,longitude = 41.806389},
		["KYZYL-POKUN"] = {latitude = 43.929167,longitude = 42.347500},
		["KYZYL-URUP"] = {latitude = 44.005556,longitude = 41.241667},
		["L'VOVSKOE"] = {latitude = 44.991111,longitude = 38.638889},
		["LABRA"] = {latitude = 42.811111,longitude = 41.413333},
		["LADZHANA"] = {latitude = 42.627778,longitude = 42.865556},
		["LAHUNDARA"] = {latitude = 42.051944,longitude = 43.111389},
		["LAILASHI"] = {latitude = 42.608056,longitude = 42.885833},
		["LAITURI"] = {latitude = 41.918889,longitude = 41.916944},
		["LANCHHUTI"] = {latitude = 42.084722,longitude = 42.055000},
		["LARCHVA"] = {latitude = 42.354167,longitude = 41.856111},
		["LASURIASHI"] = {latitude = 42.615833,longitude = 42.785278},
		["LAZAREVSKOE"] = {latitude = 43.911944,longitude = 39.340000},
		["LECHKOP"] = {latitude = 43.007222,longitude = 40.964444},
		["LEDARSALE"] = {latitude = 42.589444,longitude = 42.201667},
		["LEDGEBE"] = {latitude = 42.484167,longitude = 42.298611},
		["LEGAHARE"] = {latitude = 42.613056,longitude = 42.194722},
		["LEGOGIE-NASADZHU"] = {latitude = 42.444444,longitude = 42.202778},
		["LEGVA"] = {latitude = 41.855833,longitude = 41.937222},
		["LEGVANI"] = {latitude = 41.962500,longitude = 43.275278},
		["LEHAINDRAVO"] = {latitude = 42.353333,longitude = 42.362500},
		["LEHARCHILE"] = {latitude = 42.643333,longitude = 42.158333},
		["LEKADZHAIE"] = {latitude = 42.403889,longitude = 42.313333},
		["LEMIKAVE"] = {latitude = 42.426389,longitude = 42.262778},
		["LENINSKII"] = {latitude = 45.167778,longitude = 38.242778},
		["LENTEHI"] = {latitude = 42.788333,longitude = 42.751389},
		["LEPOCHHUE"] = {latitude = 42.329444,longitude = 42.269167},
		["LESA"] = {latitude = 42.077778,longitude = 41.979722},
		["LESELIDZE"] = {latitude = 43.393056,longitude = 40.045556},
		["LESINDI"] = {latitude = 42.620000,longitude = 42.810000},
		["LESO-KEFAR'"] = {latitude = 43.788056,longitude = 41.469167},
		["LESOGORSKAYA"] = {latitude = 44.545556,longitude = 39.548889},
		["LETSITSHVAIE"] = {latitude = 42.378333,longitude = 42.393333},
		["LETSURTSUME"] = {latitude = 42.530833,longitude = 42.144167},
		["LEVAHANE"] = {latitude = 42.345556,longitude = 42.227222},
		["LIA"] = {latitude = 42.658333,longitude = 42.026111},
		["LIDZAVA"] = {latitude = 43.179722,longitude = 40.378889},
		["LIHAURI"] = {latitude = 41.877222,longitude = 42.021389},
		["LIHETI"] = {latitude = 42.604444,longitude = 43.264722},
		["LINEINAYA"] = {latitude = 44.591389,longitude = 39.500278},
		["LOO"] = {latitude = 43.705000,longitude = 39.599167},
		["LUNACHARSKII"] = {latitude = 43.903611,longitude = 42.719722},
		["LYHNY"] = {latitude = 43.149444,longitude = 40.626667},
		["MACHHVARETI"] = {latitude = 42.068333,longitude = 42.028056},
		["MAEVSKII"] = {latitude = 45.165556,longitude = 38.169722},
		["MAGLAKI"] = {latitude = 42.261111,longitude = 42.590833},
		["MAGRI"] = {latitude = 44.021667,longitude = 39.171111},
		["MAHARADZE"] = {latitude = 41.934722,longitude = 41.991389},
		["MAHASHI"] = {latitude = 42.604167,longitude = 42.775278},
		["MAHATAURI"] = {latitude = 42.283889,longitude = 43.493889},
		["MAHINDZHAURI"] = {latitude = 41.676389,longitude = 41.715278},
		["MAHO"] = {latitude = 41.557778,longitude = 41.695000},
		["MAHVILAURI"] = {latitude = 41.610000,longitude = 41.672222},
		["MAIDANI"] = {latitude = 42.283611,longitude = 42.334444},
		["MAIKOP"] = {latitude = 44.605556,longitude = 40.115833},
		["MAISAURI"] = {latitude = 42.033889,longitude = 42.467500},
		["MAKATUBANI"] = {latitude = 42.116944,longitude = 43.270000},
		["MAKOPSE"] = {latitude = 43.995278,longitude = 39.226389},
		["MAL.ZELENCHUK"] = {latitude = 44.160278,longitude = 41.885000},
		["MALOKURGANNYI"] = {latitude = 43.842222,longitude = 41.929167},
		["MALOTENGINSKAYA"] = {latitude = 44.282778,longitude = 41.547222},
		["MAMAIKA"] = {latitude = 43.633611,longitude = 39.715556},
		["MAMATI"] = {latitude = 42.022500,longitude = 42.049722},
		["MAMHEG"] = {latitude = 45.009722,longitude = 40.230833},
		["MAMYDZHIRHVA"] = {latitude = 43.192500,longitude = 40.555000},
		["MANDAETI"] = {latitude = 42.178333,longitude = 43.364444},
		["MAR'INAROSCHA"] = {latitude = 44.619444,longitude = 38.035278},
		["MAR'YANSKAYA"] = {latitude = 45.101389,longitude = 38.646111},
		["MARANI"] = {latitude = 42.163611,longitude = 42.304167},
		["MARELISI"] = {latitude = 41.952222,longitude = 43.304444},
		["MARTANSKAYA"] = {latitude = 44.760000,longitude = 39.448333},
		["MARTOTUBANI"] = {latitude = 42.124444,longitude = 43.125833},
		["MARTVILI"] = {latitude = 42.406389,longitude = 42.395000},
		["MARUHA"] = {latitude = 43.764444,longitude = 41.655278},
		["MATHODZHI"] = {latitude = 42.383889,longitude = 42.463611},
		["MAZANDARA"] = {latitude = 42.618333,longitude = 42.067778},
		["MECHHETURI"] = {latitude = 42.151944,longitude = 43.385000},
		["MEDANI"] = {latitude = 42.672222,longitude = 42.159722},
		["MEDNOGORSKII"] = {latitude = 43.913889,longitude = 41.205000},
		["MEDZHINISTSKALI"] = {latitude = 41.592500,longitude = 41.651667},
		["MELAURI"] = {latitude = 42.185278,longitude = 42.411111},
		["MELEKEDURI"] = {latitude = 41.949167,longitude = 42.035556},
		["MEORE"] = {latitude = 42.472222,longitude = 42.326667},
		["MEOREGURIPULI"] = {latitude = 42.291667,longitude = 41.914444},
		["MEORE-BALDA"] = {latitude = 42.497222,longitude = 42.413611},
		["MEORE-CHOGA"] = {latitude = 42.551667,longitude = 42.218611},
		["MEORE-GUDAVA"] = {latitude = 42.646389,longitude = 41.560000},
		["MEORE-MOHASHI"] = {latitude = 42.389444,longitude = 42.175556},
		["MEORE-OBCHA"] = {latitude = 42.103333,longitude = 42.912778},
		["MEORE-ONTOPO"] = {latitude = 42.235556,longitude = 42.265833},
		["MEORE-OTOBAYA"] = {latitude = 42.455833,longitude = 41.663889},
		["MEORE-SVIRI"] = {latitude = 42.107222,longitude = 42.951944},
		["MEORE-TOLA"] = {latitude = 42.586667,longitude = 43.030556},
		["MERCHANSKOE"] = {latitude = 44.948056,longitude = 38.137222},
		["MERDZHEVI"] = {latitude = 42.301111,longitude = 43.460833},
		["MERHEULI"] = {latitude = 42.987500,longitude = 41.177500},
		["MERIA"] = {latitude = 41.943889,longitude = 41.913333},
		["MERKULA"] = {latitude = 42.765000,longitude = 41.496944},
		["MESAME-BALDA"] = {latitude = 42.490278,longitude = 42.411111},
		["MESSAZHAI"] = {latitude = 44.139722,longitude = 39.130000},
		["MESTIA"] = {latitude = 43.045000,longitude = 42.7569444},
		["METSIETI"] = {latitude = 41.951667,longitude = 42.211667},
		["MEZMAI"] = {latitude = 44.200000,longitude = 39.970278},
		["MGVIMEVI"] = {latitude = 42.320000,longitude = 43.358056},
		["MHHIANI"] = {latitude = 42.197222,longitude = 42.620556},
		["MIHAILOVSKIIPEREVAL"] = {latitude = 44.512500,longitude = 38.323889},
		["MIHAILOVSKOE"] = {latitude = 45.005556,longitude = 38.514167},
		["MIKAVA"] = {latitude = 42.620833,longitude = 42.127222},
		["MIKELEPONI"] = {latitude = 42.048333,longitude = 42.480278},
		["MINGREL'SKAYA"] = {latitude = 45.009167,longitude = 38.349722},
		["MIRNYI"] = {latitude = 44.605278,longitude = 39.017222},
		["MITSABOGIRA"] = {latitude = 42.209722,longitude = 42.394722},
		["MITSATSITELI"] = {latitude = 42.235556,longitude = 42.563333},
		["MODZVI"] = {latitude = 42.257500,longitude = 43.452222},
		["MOGIRI"] = {latitude = 42.375556,longitude = 41.746389},
		["MOGUKOROVSKII"] = {latitude = 45.150000,longitude = 38.208333},
		["MOHASHI"] = {latitude = 42.414444,longitude = 42.212778},
		["MOHVA"] = {latitude = 42.402222,longitude = 43.358333},
		["MOIDANAHE"] = {latitude = 42.543611,longitude = 42.160556},
		["MOLDAVANSKOE"] = {latitude = 44.941667,longitude = 37.876944},
		["MOLDOVKA"] = {latitude = 43.453889,longitude = 39.955556},
		["MOLODEZHNYI"] = {latitude = 44.676667,longitude = 39.689444},
		["MONGIRI"] = {latitude = 42.488333,longitude = 42.171944},
		["MTERCHVEULI"] = {latitude = 42.059444,longitude = 42.400000},
		["MTISDZIRI"] = {latitude = 42.105278,longitude = 42.445833},
		["MTISPIRI"] = {latitude = 41.938611,longitude = 42.177778},
		["MTSVANE-KONTSHI"] = {latitude = 41.689722,longitude = 41.723889},
		["MUGUDZYRHVA"] = {latitude = 43.156667,longitude = 40.530000},
		["MUHAESTATE"] = {latitude = 41.836667,longitude = 41.861111},
		["MUHURA"] = {latitude = 42.319722,longitude = 43.117500},
		["MUHURCHA"] = {latitude = 42.318056,longitude = 42.270278},
		["MUHURI"] = {latitude = 42.690278,longitude = 41.716389},
		["MUZHAVA"] = {latitude = 42.711667,longitude = 42.010278},
		["MYSHAKO"] = {latitude = 44.659167,longitude = 37.768333},
		["MYUSSERA"] = {latitude = 43.156389,longitude = 40.468333},
		["MZAHVA"] = {latitude = 43.139444,longitude = 40.601111},
		["MZIANI"] = {latitude = 41.977222,longitude = 42.173611},
		["MZIURI"] = {latitude = 42.617222,longitude = 41.740556},
		["NABAKEVI"] = {latitude = 42.503611,longitude = 41.680833},
		["NABOSLEVI"] = {latitude = 42.315833,longitude = 42.831111},
		["NADABURI"] = {latitude = 42.121111,longitude = 43.456944},
		["NADEZHNAYA"] = {latitude = 44.203056,longitude = 41.421944},
		["NADZHAHAVO"] = {latitude = 42.347222,longitude = 42.340000},
		["NAESAKAO"] = {latitude = 42.178056,longitude = 42.228333},
		["NAGAREVI"] = {latitude = 42.248333,longitude = 42.816389},
		["NAGEBERAVO"] = {latitude = 42.330000,longitude = 42.336111},
		["NAGOBILEVI"] = {latitude = 41.942778,longitude = 41.879444},
		["NAGOMARI"] = {latitude = 41.990000,longitude = 42.130833},
		["NAGURU"] = {latitude = 42.693056,longitude = 42.119722},
		["NAHAHULEVI"] = {latitude = 42.358611,longitude = 42.459167},
		["NAHAREBAVO"] = {latitude = 42.384722,longitude = 42.406667},
		["NAHSHIRGELE"] = {latitude = 42.221111,longitude = 42.849444},
		["NAHUNAO"] = {latitude = 42.428889,longitude = 42.345833},
		["NAHURTSILAVO"] = {latitude = 42.447222,longitude = 42.295833},
		["NAKADULI"] = {latitude = 42.026944,longitude = 42.341667},
		["NAKIPU"] = {latitude = 42.561389,longitude = 42.094167},
		["NAKURALESHI"] = {latitude = 42.550000,longitude = 42.772778},
		["NALEPSAO"] = {latitude = 42.432500,longitude = 42.388889},
		["NAMIKOLAVO"] = {latitude = 42.475000,longitude = 42.350278},
		["NAMOHVANI"] = {latitude = 42.418889,longitude = 42.721944},
		["NAOCHI"] = {latitude = 42.776944,longitude = 41.370278},
		["NAPICHHOVO"] = {latitude = 42.596111,longitude = 42.242778},
		["NAPOSHTU"] = {latitude = 42.327500,longitude = 41.951389},
		["NARAZENI"] = {latitude = 42.391389,longitude = 41.935556},
		["NASPERI"] = {latitude = 42.588056,longitude = 42.795000},
		["NATSATU"] = {latitude = 42.567778,longitude = 42.001389},
		["NATSULUKU"] = {latitude = 42.550833,longitude = 41.905000},
		["NATUHAEVSKAYA"] = {latitude = 44.906389,longitude = 37.575000},
		["NAVAGINKA"] = {latitude = 43.620278,longitude = 39.755278},
		["NAVARDZETI"] = {latitude = 42.278889,longitude = 43.239444},
		["NAVENAHEVI"] = {latitude = 42.248056,longitude = 42.885278},
		["NEBERDZHAEVSKAYA"] = {latitude = 44.826667,longitude = 37.903056},
		["NEBODZIRI"] = {latitude = 41.983333,longitude = 43.398889},
		["NEBUG"] = {latitude = 44.173056,longitude = 39.011944},
		["NEFTEGORSK"] = {latitude = 44.362778,longitude = 39.725278},
		["NEFTYANAYA"] = {latitude = 44.378056,longitude = 39.654444},
		["NEKRASOVSKAYA"] = {latitude = 45.143056,longitude = 39.763611},
		["NERGEETI"] = {latitude = 42.051944,longitude = 42.848333},
		["NESHUKAI"] = {latitude = 44.906111,longitude = 39.428333},
		["NEZHINSKII"] = {latitude = 43.930000,longitude = 42.715000},
		["NIABAURI"] = {latitude = 41.868333,longitude = 42.028056},
		["NIGOITI"] = {latitude = 42.083889,longitude = 42.127500},
		["NIGORZGVA"] = {latitude = 42.082778,longitude = 42.340278},
		["NIGOZETI"] = {latitude = 42.213889,longitude = 43.393889},
		["NIGVZARA"] = {latitude = 42.209167,longitude = 43.494167},
		["NIGVZIANI"] = {latitude = 42.067500,longitude = 41.895833},
		["NIKOLAENKO"] = {latitude = 44.406389,longitude = 39.685000},
		["NIKOLAEVSKOE"] = {latitude = 44.120556,longitude = 42.153333},
		["NIKORTSMINDA"] = {latitude = 42.461667,longitude = 43.120000},
		["NINOSHVILI"] = {latitude = 42.042500,longitude = 41.969167},
		["NINUA-KUTHE"] = {latitude = 42.223611,longitude = 42.357222},
		["NIZH.ARMYANSKOEUSCHEL'E"] = {latitude = 43.085000,longitude = 40.810278},
		["NIZH.MTSARA"] = {latitude = 43.142500,longitude = 40.780833},
		["NIZH.-PSHAP"] = {latitude = 42.888889,longitude = 41.145556},
		["NIZH.-YASHHTVA"] = {latitude = 43.018056,longitude = 41.027222},
		["NIZH.ARHYZ"] = {latitude = 43.679167,longitude = 41.478889},
		["NIZH.ERMOLOVKA"] = {latitude = 43.751389,longitude = 41.528333},
		["NIZH.SHILOVKA"] = {latitude = 43.464722,longitude = 40.037222},
		["NIZH.TEBERDA"] = {latitude = 43.636389,longitude = 41.894722},
		["NIZHNE-VYSOKOE"] = {latitude = 43.474722,longitude = 39.985556},
		["NIZHNEBAKANSKII"] = {latitude = 44.863611,longitude = 37.873333},
		["NIZHNYAYAGOSTAGAIKA"] = {latitude = 45.035556,longitude = 37.356389},
		["NOGA"] = {latitude = 42.072222,longitude = 42.311111},
		["NOSIRI"] = {latitude = 42.274167,longitude = 42.161111},
		["NOV.DZHEGUTA"] = {latitude = 44.005556,longitude = 42.064722},
		["NOV.MATSESTA"] = {latitude = 43.560000,longitude = 39.814444},
		["NOV.TEBERDA"] = {latitude = 43.673056,longitude = 51.916389},
		["NOVAYAADYGEYA"] = {latitude = 45.022500,longitude = 38.947500},
		["NOVAYAAKVASKIA"] = {latitude = 42.795556,longitude = 41.557500},
		["NOVOALEKSEEVSKOE"] = {latitude = 44.952778,longitude = 39.876389},
		["NOVOBLAGODARNOE"] = {latitude = 44.144167,longitude = 42.905278},
		["NOVOBZHEGOKAI"] = {latitude = 44.929722,longitude = 38.847778},
		["NOVODMITRIEVSKAYA"] = {latitude = 44.829444,longitude = 38.889722},
		["NOVOISPRAVNENSKOE"] = {latitude = 43.978333,longitude = 41.563889},
		["NOVOLABINSKAYA"] = {latitude = 45.110556,longitude = 39.907222},
		["NOVOMIHAILOVSKII"] = {latitude = 44.257222,longitude = 38.863056},
		["NOVOMYSHASTOVSKAYA"] = {latitude = 45.196389,longitude = 38.588333},
		["NOVOROSSIISK"] = {latitude = 44.717778,longitude = 37.769167},
		["NOVOSEVASTOPOL'SKOE"] = {latitude = 45.059444,longitude = 39.716389},
		["NOVOTITAROVSKAYA"] = {latitude = 45.234444,longitude = 38.981944},
		["NOVOTROITSKII"] = {latitude = 45.025833,longitude = 38.016667},
		["NOVOUKRAINSKII"] = {latitude = 44.891389,longitude = 38.057222},
		["NOVOVELICHKOVSKAYA"] = {latitude = 45.275556,longitude = 38.851667},
		["NOVYEPOLYANY"] = {latitude = 44.300556,longitude = 39.839722},
		["NOVYI"] = {latitude = 45.003889,longitude = 38.988333},
		["NOVYIAFON"] = {latitude = 43.091111,longitude = 40.825556},
		["NOVYIKARACHAI"] = {latitude = 43.818333,longitude = 41.926389},
		["NOVYISAD"] = {latitude = 44.902222,longitude = 38.918056},
		["OBUDZHI"] = {latitude = 42.555556,longitude = 42.035556},
		["OCHAMCHIRA"] = {latitude = 42.717222,longitude = 41.488611},
		["OCHE"] = {latitude = 42.522778,longitude = 42.335278},
		["OCHHAMURI"] = {latitude = 41.857222,longitude = 41.849444},
		["OCHHOMURI"] = {latitude = 42.470000,longitude = 42.100278},
		["ODILAURI"] = {latitude = 42.217778,longitude = 42.757500},
		["ODISHI"] = {latitude = 43.075000,longitude = 41.108889},
		["ODZHOLA"] = {latitude = 42.385556,longitude = 42.810556},
		["OHVAMEKARI"] = {latitude = 42.368333,longitude = 41.851389},
		["OIREME"] = {latitude = 42.468056,longitude = 41.828611},
		["OKONA"] = {latitude = 42.240833,longitude = 42.990000},
		["OKTOMBERI"] = {latitude = 43.031667,longitude = 41.246944},
		["OKTYABR'SKAYA"] = {latitude = 44.851389,longitude = 39.630000},
		["OKTYABR'SKII"] = {latitude = 45.230000,longitude = 38.300000},
		["OKUMI"] = {latitude = 42.724167,longitude = 41.774167},
		["OKURESHI"] = {latitude = 42.540833,longitude = 42.698333},
		["OL'GINSKII"] = {latitude = 45.119167,longitude = 38.367500},
		["OMPARETI"] = {latitude = 42.020833,longitude = 41.829167},
		["ONDZHOHETI"] = {latitude = 42.031111,longitude = 42.528889},
		["ONI"] = {latitude = 42.586667,longitude = 43.480278},
		["ONOGIA"] = {latitude = 42.321667,longitude = 42.325278},
		["OPACHHAPU"] = {latitude = 42.444167,longitude = 41.932222},
		["OPSHKVITI"] = {latitude = 42.146389,longitude = 42.627500},
		["OPURCHHETI"] = {latitude = 42.355278,longitude = 42.726111},
		["ORBELI"] = {latitude = 42.634167,longitude = 42.851111},
		["ORDZHONIKIDZE"] = {latitude = 42.640000,longitude = 42.048333},
		["ORDZHONIKIDZE"] = {latitude = 42.001667,longitude = 43.199722},
		["ORDZHONIKIDZEVSKII"] = {latitude = 43.842500,longitude = 41.915278},
		["OREL"] = {latitude = 43.461111,longitude = 39.933333},
		["ORHVI"] = {latitude = 42.503611,longitude = 42.827222},
		["ORKA"] = {latitude = 42.308056,longitude = 42.267222},
		["ORPIRI"] = {latitude = 42.328611,longitude = 42.842778},
		["ORSANTIA"] = {latitude = 42.472222,longitude = 41.688333},
		["ORULU"] = {latitude = 42.393889,longitude = 41.731944},
		["OSTROVSKAYASCHEL'"] = {latitude = 44.276944,longitude = 39.303611},
		["OTD.N3SKZNIISIV"] = {latitude = 45.130556,longitude = 38.975000},
		["OTHARA"] = {latitude = 43.228333,longitude = 40.550000},
		["OTOBAYA"] = {latitude = 42.482500,longitude = 41.644444},
		["OTRADNOE"] = {latitude = 43.265833,longitude = 40.303333},
		["OTRADNYI"] = {latitude = 44.870000,longitude = 38.962500},
		["OZURGETI"] = {latitude = 41.927500,longitude = 42.032500},
		["PAHULANI"] = {latitude = 42.653333,longitude = 42.009722},
		["PAMPALETI"] = {latitude = 41.931944,longitude = 42.139722},
		["PANAHES"] = {latitude = 44.982222,longitude = 38.725833},
		["PARAHETI"] = {latitude = 42.548611,longitude = 43.349444},
		["PARTONOHORI"] = {latitude = 42.650833,longitude = 41.883056},
		["PARTSHANAKANEVI"] = {latitude = 42.202778,longitude = 42.581944},
		["PARTSHNALI"] = {latitude = 42.003056,longitude = 43.150000},
		["PASHKOVSKII"] = {latitude = 45.019444,longitude = 39.113611},
		["PATARA-DZHIHAISHI"] = {latitude = 42.280556,longitude = 42.428056},
		["PATARA-ETSERI"] = {latitude = 42.197500,longitude = 42.405556},
		["PATARA-HARAGOULI"] = {latitude = 42.016667,longitude = 43.227222},
		["PATARA-KUHI"] = {latitude = 42.306944,longitude = 42.470278},
		["PATARA-ONI"] = {latitude = 42.532222,longitude = 43.007222},
		["PATARA-POTI"] = {latitude = 42.181944,longitude = 41.757778},
		["PATRIKETI"] = {latitude = 42.152778,longitude = 42.679722},
		["PAVLOVSKII"] = {latitude = 45.071667,longitude = 37.779167},
		["PAVLOVSKOE"] = {latitude = 43.067500,longitude = 41.131667},
		["PCHEGATLUKAI"] = {latitude = 44.882778,longitude = 39.273611},
		["PEREDOVAYA"] = {latitude = 44.119444,longitude = 41.496111},
		["PERETA"] = {latitude = 42.059722,longitude = 42.738056},
		["PEREVALKA"] = {latitude = 44.050556,longitude = 40.775278},
		["PEREVISA"] = {latitude = 42.256111,longitude = 43.323056},
		["PERSATI"] = {latitude = 42.065278,longitude = 42.811944},
		["PERVELI-OHUREI"] = {latitude = 42.736944,longitude = 41.597500},
		["PERVOMAISKII"] = {latitude = 44.893889,longitude = 39.752500},
		["PERVOMAISKOE"] = {latitude = 43.937500,longitude = 42.513889},
		["PERVORECHENSKOE"] = {latitude = 45.155278,longitude = 39.317222},
		["PIRVELI"] = {latitude = 42.488889,longitude = 41.630000},
		["PIRVELI"] = {latitude = 42.474722,longitude = 42.313889},
		["PIRVELI-AKVAGA"] = {latitude = 42.601944,longitude = 41.791389},
		["PIRVELI-CHOGA"] = {latitude = 42.574167,longitude = 42.218056},
		["PIRVELI-ETSERI"] = {latitude = 42.181944,longitude = 42.178611},
		["PIRVELI-GUDAVA"] = {latitude = 42.663333,longitude = 41.576944},
		["PIRVELI-GURDZEMI"] = {latitude = 42.468611,longitude = 42.287500},
		["PIRVELI-GURIPULI"] = {latitude = 42.301111,longitude = 41.899722},
		["PIRVELI-MAISI"] = {latitude = 42.136111,longitude = 42.305000},
		["PIRVELI-OBCHA"] = {latitude = 42.093889,longitude = 42.879722},
		["PIRVELI-ONTOPO"] = {latitude = 42.248333,longitude = 42.269167},
		["PIRVELI-SVIRI"] = {latitude = 42.102778,longitude = 42.986944},
		["PIRVELI-TOLA"] = {latitude = 42.570556,longitude = 43.011667},
		["PITSARGALI"] = {latitude = 42.531389,longitude = 41.614722},
		["PITSUNDA"] = {latitude = 43.163889,longitude = 40.354444},
		["PLASTUNKA"] = {latitude = 43.672222,longitude = 39.773889},
		["PLASTUNOVSKAYA"] = {latitude = 45.290833,longitude = 39.278611},
		["PLAVNENSKII"] = {latitude = 45.030833,longitude = 37.938889},
		["POBEDA"] = {latitude = 44.560278,longitude = 40.156111},
		["PODGORNAYA"] = {latitude = 44.213056,longitude = 41.302500},
		["PODGORNYI"] = {latitude = 44.688056,longitude = 40.100556},
		["PODKUMOK"] = {latitude = 43.968056,longitude = 42.804167},
		["POKROVSKII"] = {latitude = 45.105000,longitude = 38.424167},
		["POKVESH"] = {latitude = 42.796667,longitude = 41.586944},
		["PONEZHUKAI"] = {latitude = 44.886667,longitude = 39.392778},
		["POTI"] = {latitude = 42.148889,longitude = 41.694444},
		["POTSHO"] = {latitude = 42.431944,longitude = 42.190833},
		["PRAVOKUBANSKII"] = {latitude = 43.919444,longitude = 41.906111},
		["PREGRADNAYA"] = {latitude = 43.951389,longitude = 41.204722},
		["PREOBRAZHENSKOE"] = {latitude = 45.082500,longitude = 39.634722},
		["PRIGORODNYI"] = {latitude = 44.122778,longitude = 39.129444},
		["PRIKUBANSKIEHUTORA"] = {latitude = 45.159444,longitude = 38.087500},
		["PRIKUBANSKII"] = {latitude = 44.953056,longitude = 39.036111},
		["PRIMORSKII"] = {latitude = 45.257500,longitude = 36.915278},
		["PRIMORSKOE"] = {latitude = 43.095278,longitude = 40.720000},
		["PRIRECHENSKII"] = {latitude = 44.750833,longitude = 39.252222},
		["PROGRESS"] = {latitude = 44.868611,longitude = 40.203056},
		["PROLETARSKII"] = {latitude = 44.619167,longitude = 40.196667},
		["PROTICHKA"] = {latitude = 45.372500,longitude = 38.077778},
		["PSAUCH'E-DAHE"] = {latitude = 44.214722,longitude = 41.903056},
		["PSEBAI"] = {latitude = 44.135556,longitude = 40.834444},
		["PSEITUH"] = {latitude = 45.048333,longitude = 38.713333},
		["PSEKUPS"] = {latitude = 44.830556,longitude = 39.217778},
		["PSEMEN"] = {latitude = 43.981111,longitude = 40.989722},
		["PSHADA"] = {latitude = 44.469444,longitude = 38.409167},
		["PSHAP"] = {latitude = 42.897500,longitude = 41.119722},
		["PSHEHSKAYA"] = {latitude = 44.695000,longitude = 39.808611},
		["PSHICHO"] = {latitude = 45.061944,longitude = 40.187778},
		["PSHIZOV"] = {latitude = 45.091667,longitude = 40.117222},
		["PSYRTSHA"] = {latitude = 43.087778,longitude = 40.895556},
		["PTITSEFABRIKA"] = {latitude = 43.186389,longitude = 40.302222},
		["PUTI"] = {latitude = 42.066944,longitude = 43.122222},
		["PYATIGORSKAYA"] = {latitude = 44.606944,longitude = 39.038611},
		["PYATIHATKI"] = {latitude = 44.974167,longitude = 37.309167},
		["RAEVSKAYA"] = {latitude = 44.830000,longitude = 37.565278},
		["RASSVET"] = {latitude = 44.892500,longitude = 37.461944},
		["RAZDOL'NOE"] = {latitude = 43.566944,longitude = 39.788056},
		["RECHHI"] = {latitude = 42.658889,longitude = 41.770278},
		["REPO-ETSERI"] = {latitude = 42.633889,longitude = 41.677778},
		["RGANI"] = {latitude = 42.317222,longitude = 43.270278},
		["RIKE"] = {latitude = 42.587778,longitude = 41.910556},
		["RIM-GORSKII"] = {latitude = 43.956944,longitude = 42.550833},
		["RIONI"] = {latitude = 42.332778,longitude = 42.738056},
		["RISOOPYTNYI"] = {latitude = 45.223889,longitude = 38.317500},
		["RODINAULI"] = {latitude = 42.149444,longitude = 42.893611},
		["RODNIKI"] = {latitude = 44.737500,longitude = 39.926389},
		["RODNIKOVYI"] = {latitude = 44.678611,longitude = 40.015556},
		["ROHI"] = {latitude = 42.103889,longitude = 42.733889},
		["ROMANETI"] = {latitude = 42.032778,longitude = 42.689444},
		["RTSHILATI"] = {latitude = 42.322500,longitude = 43.163611},
		["RUHI"] = {latitude = 42.547222,longitude = 41.869722},
		["RUPOTI"] = {latitude = 42.224167,longitude = 43.051389},
		["RUSSKAYAMAMAIKA"] = {latitude = 43.650278,longitude = 39.726389},
		["RUSSKOE"] = {latitude = 44.956111,longitude = 37.845278},
		["RYAZANSKAYA"] = {latitude = 44.958056,longitude = 39.594722},
		["SABAZHO"] = {latitude = 42.221667,longitude = 41.815278},
		["SABE"] = {latitude = 42.042500,longitude = 43.276944},
		["SABERIO"] = {latitude = 42.645278,longitude = 41.928611},
		["SABESELIO"] = {latitude = 42.248333,longitude = 42.171111},
		["SABULISKERIO"] = {latitude = 42.674722,longitude = 41.695278},
		["SACHHERE"] = {latitude = 42.338889,longitude = 43.437500},
		["SACHINO"] = {latitude = 42.646389,longitude = 42.102500},
		["SACHOCHUO"] = {latitude = 42.210278,longitude = 41.784722},
		["SADMELI"] = {latitude = 42.537222,longitude = 43.143333},
		["SADOVOE"] = {latitude = 45.000278,longitude = 39.708889},
		["SADOVYI"] = {latitude = 45.312778,longitude = 38.061389},
		["SADZHAVAHO"] = {latitude = 42.102778,longitude = 42.322222},
		["SAELIAVO"] = {latitude = 42.435000,longitude = 42.409167},
		["SAGVAMICHAVO"] = {latitude = 42.229167,longitude = 41.847222},
		["SAGVAZAVO"] = {latitude = 42.220833,longitude = 42.190278},
		["SAGVICHIO"] = {latitude = 42.213056,longitude = 41.890000},
		["SAHARBEDIO"] = {latitude = 42.295278,longitude = 42.054722},
		["SAIRHE"] = {latitude = 42.310000,longitude = 43.438056},
		["SAKASRIA"] = {latitude = 42.110556,longitude = 43.332778},
		["SAKETSIA"] = {latitude = 42.526944,longitude = 43.116111},
		["SAKRAULA"] = {latitude = 42.026667,longitude = 43.008889},
		["SAKULIA"] = {latitude = 42.131944,longitude = 42.585278},
		["SAKURTSE"] = {latitude = 42.275278,longitude = 43.177222},
		["SAL'ME"] = {latitude = 43.428056,longitude = 40.038611},
		["SALHINO"] = {latitude = 43.486667,longitude = 40.068056},
		["SALIBAURI"] = {latitude = 41.640833,longitude = 41.695000},
		["SALIETI"] = {latitude = 42.266667,longitude = 43.236667},
		["SALOMINAO"] = {latitude = 42.086667,longitude = 42.747778},
		["SAMEBA"] = {latitude = 41.623056,longitude = 41.698333},
		["SAMELALIO"] = {latitude = 42.706389,longitude = 41.770278},
		["SAMIKAO"] = {latitude = 42.262222,longitude = 42.317500},
		["SAMKVARI"] = {latitude = 42.648889,longitude = 41.740000},
		["SAMTREDIA"] = {latitude = 42.166667,longitude = 42.358056},
		["SAN.IM.LENINA"] = {latitude = 42.926111,longitude = 41.131944},
		["SANAHSHIRE"] = {latitude = 42.119722,longitude = 43.148889},
		["SAODISHARIO"] = {latitude = 42.247778,longitude = 42.133889},
		["SAPRASIA"] = {latitude = 42.034722,longitude = 42.667222},
		["SARAKONI"] = {latitude = 42.502222,longitude = 42.081389},
		["SARATOVSKAYA"] = {latitude = 44.710833,longitude = 39.231389},
		["SARATOVSKII"] = {latitude = 45.203056,longitude = 39.998889},
		["SAREKI"] = {latitude = 42.326667,longitude = 43.388333},
		["SARGVESHI"] = {latitude = 42.056389,longitude = 43.253889},
		["SARY-TYUZ"] = {latitude = 43.901667,longitude = 41.918056},
		["SASASHI"] = {latitude = 42.795833,longitude = 43.005556},
		["SASHAMUGIO"] = {latitude = 42.580000,longitude = 41.676389},
		["SATKEBUCHAO"] = {latitude = 42.402222,longitude = 42.080000},
		["SATSIRE"] = {latitude = 42.340000,longitude = 42.962500},
		["SATSULUKIDZE"] = {latitude = 42.341667,longitude = 42.464722},
		["SAUKDERE"] = {latitude = 44.899444,longitude = 37.893889},
		["SAVANE"] = {latitude = 42.310278,longitude = 43.499444},
		["SAZANO"] = {latitude = 42.214167,longitude = 43.088333},
		["SCHASTLIVOE"] = {latitude = 44.163611,longitude = 42.288889},
		["SEMISVODNYI"] = {latitude = 45.294444,longitude = 37.977222},
		["SENAKI"] = {latitude = 42.270556,longitude = 42.075556},
		["SENNOI"] = {latitude = 45.286944,longitude = 37.003889},
		["SEPIETI"] = {latitude = 42.283611,longitude = 42.265000},
		["SERBAISI"] = {latitude = 41.946944,longitude = 43.361667},
		["SERGIETI"] = {latitude = 42.391111,longitude = 42.347500},
		["SEVA"] = {latitude = 42.550556,longitude = 43.381944},
		["SEVASTOPOL'SKAYA"] = {latitude = 44.353611,longitude = 40.321389},
		["SEVERNYI"] = {latitude = 44.656944,longitude = 40.129722},
		["SEVERO-VOSTOCHNYESADY"] = {latitude = 44.632222,longitude = 40.145833},
		["SEVERSKAYA"] = {latitude = 44.851389,longitude = 38.689167},
		["SHAHE"] = {latitude = 43.789722,longitude = 39.483611},
		["SHAMGONA"] = {latitude = 42.521111,longitude = 41.789167},
		["SHAUMYAN"] = {latitude = 44.320556,longitude = 39.301389},
		["SHAUMYANOVKA"] = {latitude = 42.911944,longitude = 41.213889},
		["SHEDOK"] = {latitude = 44.218611,longitude = 40.861389},
		["SHEMOKMEDI"] = {latitude = 41.898056,longitude = 42.084722},
		["SHENDZHII"] = {latitude = 44.881111,longitude = 39.072222},
		["SHEPSI"] = {latitude = 44.037778,longitude = 39.155000},
		["SHEVCHENKO"] = {latitude = 44.895278,longitude = 39.529722},
		["SHIROKAYABALKA"] = {latitude = 44.484722,longitude = 39.425000},
		["SHIRVANSKAYA"] = {latitude = 44.376667,longitude = 39.821944},
		["SHITSKVARA"] = {latitude = 43.071111,longitude = 40.944167},
		["SHKOL'NOE"] = {latitude = 44.914167,longitude = 39.868889},
		["SHKOL'NYI"] = {latitude = 45.027778,longitude = 37.621111},
		["SHLITI"] = {latitude = 41.971944,longitude = 43.236111},
		["SHOMAHETI"] = {latitude = 42.211667,longitude = 43.455833},
		["SHORAPANI"] = {latitude = 42.084722,longitude = 43.109722},
		["SHOVGENOVSKII"] = {latitude = 45.019722,longitude = 40.247222},
		["SHROMA"] = {latitude = 43.082500,longitude = 41.051389},
		["SHROMISKARI"] = {latitude = 42.357222,longitude = 42.136944},
		["SHROMISUBANI"] = {latitude = 42.030833,longitude = 41.834444},
		["SHROSHA"] = {latitude = 42.110556,longitude = 43.208889},
		["SHTURBINO"] = {latitude = 45.057778,longitude = 39.918889},
		["SHUA-BASHI"] = {latitude = 42.141944,longitude = 42.514722},
		["SHUA-GANAHLEBA"] = {latitude = 42.034444,longitude = 42.226944},
		["SHUA-GEZRULI"] = {latitude = 42.149167,longitude = 43.248333},
		["SHUA-GORA"] = {latitude = 42.072778,longitude = 42.722778},
		["SHUA-GUBI"] = {latitude = 42.259167,longitude = 42.487222},
		["SHUA-HORSHI"] = {latitude = 42.346111,longitude = 42.038889},
		["SHUA-KVALITI"] = {latitude = 42.083056,longitude = 43.038056},
		["SHUA-NOSIRI"] = {latitude = 42.280556,longitude = 42.113611},
		["SHUA-PARTSHMA"] = {latitude = 42.031389,longitude = 42.245000},
		["SHUA-SHVAVA"] = {latitude = 42.495833,longitude = 43.251389},
		["SHUA-SUREBI"] = {latitude = 41.969444,longitude = 42.436944},
		["SHUAGELE"] = {latitude = 41.759722,longitude = 41.805833},
		["SHUAMTA"] = {latitude = 42.095000,longitude = 42.473889},
		["SHUBANI"] = {latitude = 42.066944,longitude = 42.800556},
		["SHUNTUK"] = {latitude = 44.452222,longitude = 40.181944},
		["SHVITORI"] = {latitude = 42.354722,longitude = 43.455000},
		["SIBIRSKII"] = {latitude = 43.988889,longitude = 39.238056},
		["SIDA"] = {latitude = 42.569722,longitude = 41.730833},
		["SIKTARVA"] = {latitude = 42.188333,longitude = 42.968611},
		["SIMONETI"] = {latitude = 42.238056,longitude = 42.940000},
		["SINEGORSK"] = {latitude = 44.771111,longitude = 38.349167},
		["SKINDORI"] = {latitude = 42.237778,longitude = 43.277778},
		["SKURA"] = {latitude = 41.865556,longitude = 41.941944},
		["SKURDI"] = {latitude = 42.474722,longitude = 42.393889},
		["SLAVYANSK-NA-KUBANI"] = {latitude = 45.246389,longitude = 38.128611},
		["SMOLENSKAYA"] = {latitude = 44.785278,longitude = 38.811389},
		["SOCHHETI"] = {latitude = 42.391667,longitude = 42.935000},
		["SOCHI"] = {latitude = 43.602500,longitude = 39.737500},
		["SOGLASNYI"] = {latitude = 45.232222,longitude = 39.988056},
		["SOLENOE"] = {latitude = 44.046667,longitude = 40.896111},
		["SOLONIKI"] = {latitude = 43.883889,longitude = 39.389722},
		["SORMONI"] = {latitude = 42.317778,longitude = 42.759444},
		["SOVHOZNYI"] = {latitude = 45.290556,longitude = 38.116389},
		["SPATAGORI"] = {latitude = 42.610278,longitude = 42.848611},
		["SPETI"] = {latitude = 42.316667,longitude = 43.552778},
		["SPOKOINAYA"] = {latitude = 44.251944,longitude = 41.423333},
		["STANTSIONNYI"] = {latitude = 44.435000,longitude = 39.486389},
		["STAR.MATSESTA"] = {latitude = 43.575833,longitude = 39.813889},
		["STAROBZHEGOKAI"] = {latitude = 45.033889,longitude = 38.901111},
		["STAROKORSUNSKAYA"] = {latitude = 45.054444,longitude = 39.319444},
		["STAROTITAROVSKAYA"] = {latitude = 45.211111,longitude = 37.159444},
		["STAVROPOL'SKAYA"] = {latitude = 44.715278,longitude = 38.835833},
		["STOROZHEVAYA"] = {latitude = 43.881667,longitude = 41.473889},
		["STRELKA"] = {latitude = 45.200833,longitude = 37.292500},
		["SUDZHUNA"] = {latitude = 42.200556,longitude = 42.164722},
		["SUHCHA"] = {latitude = 42.415000,longitude = 42.494167},
		["SUHOIKUT"] = {latitude = 45.124444,longitude = 40.222222},
		["SUHUMI"] = {latitude = 43.012222,longitude = 41.003333},
		["SUKKO"] = {latitude = 44.796389,longitude = 37.427500},
		["SULORI"] = {latitude = 42.022222,longitude = 42.599167},
		["SUPOVSKII"] = {latitude = 44.898333,longitude = 38.953056},
		["SUPSA"] = {latitude = 42.041111,longitude = 41.829444},
		["SUPSEH"] = {latitude = 44.855833,longitude = 37.371667},
		["SURMUSHI"] = {latitude = 42.589167,longitude = 42.905556},
		["SUVOROV-CHERKESSKII"] = {latitude = 45.061111,longitude = 37.279444},
		["SUVOROVSKOE"] = {latitude = 45.277778,longitude = 39.477222},
		["SUZDAL'SKAYA"] = {latitude = 44.762500,longitude = 39.381389},
		["SVERI"] = {latitude = 42.221111,longitude = 43.333889},
		["SVETLYIPUT'LENINA"] = {latitude = 45.200556,longitude = 37.665278},
		["SVETMAGALI"] = {latitude = 42.139444,longitude = 42.904444},
		["SVH.AHALSOPELI"] = {latitude = 42.246944,longitude = 41.876667},
		["SVH.DIDI-CHKONSKII"] = {latitude = 45.200556,longitude = 37.666389},
		["SVH.HORSHI"] = {latitude = 42.340278,longitude = 42.053889},
		["SVH.KOHORA"] = {latitude = 42.658889,longitude = 41.725278},
		["SVH.NASAKIRALI"] = {latitude = 41.969722,longitude = 42.037222},
		["SVH.TAGRSKII"] = {latitude = 43.200556,longitude = 40.296944},
		["SVOBODA"] = {latitude = 44.152778,longitude = 42.795278},
		["SYNYRHVA"] = {latitude = 43.193333,longitude = 40.568056},
		["TABACHNYI"] = {latitude = 44.555000,longitude = 40.105278},
		["TABAGREBI"] = {latitude = 42.324167,longitude = 43.304722},
		["TABAKINI"] = {latitude = 42.061389,longitude = 43.063056},
		["TABANATI"] = {latitude = 42.050000,longitude = 41.828611},
		["TABORI"] = {latitude = 42.603056,longitude = 42.920278},
		["TAGILONI"] = {latitude = 42.546389,longitude = 41.796389},
		["TAHTAMUKAI"] = {latitude = 44.918056,longitude = 39.002500},
		["TAIA"] = {latitude = 42.608889,longitude = 42.234722},
		["TALERI"] = {latitude = 42.523611,longitude = 42.340833},
		["TALLYK"] = {latitude = 44.152222,longitude = 42.369722},
		["TAMAKONI"] = {latitude = 42.456944,longitude = 42.327222},
		["TAMAN'"] = {latitude = 45.199722,longitude = 36.719722},
		["TAMANSKII"] = {latitude = 45.142500,longitude = 36.788333},
		["TAMYSH"] = {latitude = 42.791944,longitude = 41.368611},
		["TARGAMEULI"] = {latitude = 42.442500,longitude = 42.306944},
		["TAVASA"] = {latitude = 42.271667,longitude = 43.107222},
		["TAVISUPLEBA"] = {latitude = 43.041944,longitude = 41.033333},
		["TEBERDA"] = {latitude = 43.451944,longitude = 41.761389},
		["TEKLATI"] = {latitude = 42.253611,longitude = 42.029167},
		["TELEPA"] = {latitude = 42.195278,longitude = 43.038611},
		["TELMANI"] = {latitude = 42.042222,longitude = 42.074167},
		["TEMRYUK"] = {latitude = 45.261667,longitude = 37.416111},
		["TENGINKA"] = {latitude = 44.327778,longitude = 38.794167},
		["TENGINSKAYA"] = {latitude = 45.096944,longitude = 40.024722},
		["TEREZE"] = {latitude = 43.935556,longitude = 42.471389},
		["TERZHOLA"] = {latitude = 42.191389,longitude = 43.005833},
		["TETRATSKARO"] = {latitude = 42.024722,longitude = 43.197778},
		["TEUCHEZHHABL'"] = {latitude = 44.927222,longitude = 39.574444},
		["THILNARI"] = {latitude = 41.569722,longitude = 41.659444},
		["THINA"] = {latitude = 42.880833,longitude = 41.563889},
		["THINVALI"] = {latitude = 41.969444,longitude = 41.931389},
		["THMELARI"] = {latitude = 42.142500,longitude = 42.285278},
		["TIHOVSKII"] = {latitude = 45.188333,longitude = 38.228611},
		["TIMIRYAZEVA"] = {latitude = 44.468056,longitude = 40.180278},
		["TKACHIRI"] = {latitude = 42.138889,longitude = 42.656111},
		["TKAIA"] = {latitude = 42.621667,longitude = 41.948889},
		["TKELVANI"] = {latitude = 42.046111,longitude = 42.571667},
		["TKIBULI"] = {latitude = 42.349167,longitude = 43.023333},
		["TKLAPIVAKE"] = {latitude = 42.170556,longitude = 43.094722},
		["TKVARCHELI"] = {latitude = 42.852222,longitude = 41.695278},
		["TKVIRI"] = {latitude = 42.167500,longitude = 42.266389},
		["TLYUSTENHABL'"] = {latitude = 44.979722,longitude = 39.100000},
		["TOBANIERI"] = {latitude = 42.070000,longitude = 42.459722},
		["TOLEBI"] = {latitude = 42.072500,longitude = 42.262500},
		["TRAVLEV"] = {latitude = 44.366944,longitude = 39.549167},
		["TROITSKAYA"] = {latitude = 45.131111,longitude = 38.126667},
		["TROITSKII"] = {latitude = 45.140278,longitude = 38.141667},
		["TRUDOBELIKOVSKII"] = {latitude = 45.266944,longitude = 38.152500},
		["TSACHHURI"] = {latitude = 42.536111,longitude = 42.345833},
		["TSAGERA"] = {latitude = 42.779722,longitude = 41.440278},
		["TSAGERI"] = {latitude = 42.646389,longitude = 42.793333},
		["TSAHI"] = {latitude = 42.523333,longitude = 42.948889},
		["TSAISHI"] = {latitude = 42.431111,longitude = 41.822500},
		["TSALENDZHIHA"] = {latitude = 42.615833,longitude = 42.092500},
		["TSALIKARI"] = {latitude = 42.190556,longitude = 42.168611},
		["TSALKOTI"] = {latitude = 43.408611,longitude = 40.066389},
		["TSATSHVI"] = {latitude = 42.414167,longitude = 41.808333},
		["TSEBEL'DA"] = {latitude = 43.021944,longitude = 41.286944},
		["TSEDISI"] = {latitude = 42.527222,longitude = 43.579722},
		["TSEMDOLINA"] = {latitude = 44.753889,longitude = 37.726389},
		["TSESI"] = {latitude = 42.538889,longitude = 43.224444},
		["TSHALTUBO"] = {latitude = 42.335833,longitude = 42.620833},
		["TSHALTUBO"] = {latitude = 42.316111,longitude = 42.638056},
		["TSHAMI"] = {latitude = 42.285833,longitude = 43.541944},
		["TSHEMLISHIDI"] = {latitude = 41.921389,longitude = 42.092778},
		["TSHENIS-TSKALI"] = {latitude = 42.796389,longitude = 41.437500},
		["TSHENTARO"] = {latitude = 42.145278,longitude = 42.861667},
		["TSHMORI"] = {latitude = 42.531944,longitude = 43.513611},
		["TSHRATSKARO"] = {latitude = 42.083056,longitude = 43.075556},
		["TSHUNKURI"] = {latitude = 42.396944,longitude = 42.593611},
		["TSIAGUBANI"] = {latitude = 42.048333,longitude = 42.427222},
		["TSIBANOBALKA"] = {latitude = 44.977222,longitude = 37.347500},
		["TSIHISDZIRI"] = {latitude = 41.775000,longitude = 41.782500},
		["TSILORI"] = {latitude = 42.164167,longitude = 42.247500},
		["TSINAGOLA"] = {latitude = 42.340833,longitude = 41.878611},
		["TSINAKVERKVE"] = {latitude = 42.409722,longitude = 42.332778},
		["TSIPA"] = {latitude = 42.042778,longitude = 42.973611},
		["TSIPERCHI"] = {latitude = 42.601944,longitude = 42.723333},
		["TSIPNAGVARA"] = {latitude = 41.953889,longitude = 42.243889},
		["TSIPNARA"] = {latitude = 42.021944,longitude = 42.313333},
		["TSIRKVALI"] = {latitude = 42.338889,longitude = 43.306944},
		["TSITELHEVI"] = {latitude = 42.085278,longitude = 42.808889},
		["TSITELMTA"] = {latitude = 41.908611,longitude = 42.059167},
		["TSITELSOPELI"] = {latitude = 42.316111,longitude = 43.462500},
		["TSKALAPORETI"] = {latitude = 42.030000,longitude = 43.101667},
		["TSKALSHAVI"] = {latitude = 42.213611,longitude = 43.371389},
		["TSKALTASHUA"] = {latitude = 42.019167,longitude = 42.852778},
		["TSKALTSMINDA"] = {latitude = 42.010556,longitude = 41.797222},
		["TSKAVROKA"] = {latitude = 41.858056,longitude = 41.905278},
		["TSKEMI"] = {latitude = 42.268889,longitude = 42.195000},
		["TSKNORI"] = {latitude = 42.399444,longitude = 42.915556},
		["TSKRYSH"] = {latitude = 42.785000,longitude = 41.389444},
		["TSUTSHVATI"] = {latitude = 42.286667,longitude = 42.889722},
		["TSVANE"] = {latitude = 42.370833,longitude = 41.673333},
		["TSVETOCHNYI"] = {latitude = 44.498333,longitude = 40.177222},
		["TSVIRMI"] = {latitude = 43.014722,longitude = 42.828611},
		["TSVKVARA"] = {latitude = 43.095833,longitude = 40.774444},
		["TSVYNDYRTA"] = {latitude = 43.174167,longitude = 40.737222},
		["TSYTRUSOVANI"] = {latitude = 43.086111,longitude = 40.859722},
		["TUAPSE"] = {latitude = 44.108333,longitude = 39.086667},
		["TUL'SKII"] = {latitude = 44.513889,longitude = 40.188333},
		["TURKOVSKII"] = {latitude = 45.228056,longitude = 38.180278},
		["TUZI"] = {latitude = 42.268611,longitude = 43.136389},
		["TVALUETI"] = {latitude = 42.223333,longitude = 43.296111},
		["TVANAARHU"] = {latitude = 43.198889,longitude = 40.669444},
		["TVERSKAYA"] = {latitude = 44.603889,longitude = 39.623889},
		["TVISHI"] = {latitude = 42.512222,longitude = 42.817778},
		["TVRINI"] = {latitude = 42.068611,longitude = 43.096944},
		["TYUMENSKII"] = {latitude = 44.180556,longitude = 38.983056},
		["UAZABAA"] = {latitude = 43.054444,longitude = 40.993056},
		["UBINSKAYA"] = {latitude = 44.736389,longitude = 38.547778},
		["UBISI"] = {latitude = 42.093611,longitude = 43.252500},
		["UCHAMETI"] = {latitude = 42.040556,longitude = 43.200278},
		["UCHASHONA"] = {latitude = 42.493056,longitude = 41.943611},
		["UCHKEKEN"] = {latitude = 43.939722,longitude = 42.544444},
		["UCHKULAN"] = {latitude = 43.455000,longitude = 42.112778},
		["UDOBNAYA"] = {latitude = 44.211111,longitude = 41.581389},
		["UDOBNYI"] = {latitude = 44.551944,longitude = 40.167778},
		["UHUTI"] = {latitude = 42.037778,longitude = 42.706111},
		["UKANAVA"] = {latitude = 41.935556,longitude = 42.203056},
		["UKRAINSKII"] = {latitude = 45.248056,longitude = 39.364444},
		["ULURIA"] = {latitude = 42.585278,longitude = 42.136944},
		["ULYAP"] = {latitude = 45.050278,longitude = 39.961389},
		["UREHI"] = {latitude = 41.620833,longitude = 41.669167},
		["UREKI"] = {latitude = 41.997500,longitude = 41.796667},
		["UROZHAINYI"] = {latitude = 44.116111,longitude = 42.790833},
		["URTA"] = {latitude = 42.430278,longitude = 41.860000},
		["URUP"] = {latitude = 43.850278,longitude = 41.170000},
		["URVANI"] = {latitude = 42.640833,longitude = 43.316111},
		["USAHELO"] = {latitude = 42.228889,longitude = 43.403889},
		["USHAPATI"] = {latitude = 42.403889,longitude = 42.192500},
		["UST'-DZHEGUTA"] = {latitude = 44.085000,longitude = 41.996111},
		["UST'-LABINSK"] = {latitude = 45.214167,longitude = 39.698056},
		["UTASH"] = {latitude = 45.088333,longitude = 37.325000},
		["UTSERA"] = {latitude = 42.629167,longitude = 43.569444},
		["UTSHERI"] = {latitude = 42.595000,longitude = 42.828889},
		["VACHEVI"] = {latitude = 42.313611,longitude = 43.227222},
		["VAHANI"] = {latitude = 41.941944,longitude = 43.343056},
		["VAKIDZHVARI"] = {latitude = 41.915278,longitude = 42.161667},
		["VANI"] = {latitude = 42.046667,longitude = 42.168889},
		["VANI"] = {latitude = 41.982500,longitude = 43.228611},
		["VANISKEDI"] = {latitude = 41.949167,longitude = 42.200833},
		["VARCHA"] = {latitude = 42.839444,longitude = 41.154722},
		["VARDANE"] = {latitude = 43.733056,longitude = 39.564444},
		["VARDZIA"] = {latitude = 42.033333,longitude = 43.130833},
		["VARENIKOVSKAYA"] = {latitude = 45.114722,longitude = 37.646389},
		["VARNAVINSKOE"] = {latitude = 44.989722,longitude = 38.200278},
		["VARTSIHE"] = {latitude = 42.141944,longitude = 42.740278},
		["VARVAROVKA"] = {latitude = 44.831389,longitude = 37.378333},
		["VASIL'EVSKII"] = {latitude = 45.085833,longitude = 38.539444},
		["VASYURINSKAYA"] = {latitude = 45.115833,longitude = 39.428889},
		["VAZHNOE"] = {latitude = 43.990278,longitude = 41.964167},
		["VAZIANI"] = {latitude = 41.991667,longitude = 42.264167},
		["VEDIDKARI"] = {latitude = 42.323056,longitude = 42.299722},
		["VELIKOVECHNOE"] = {latitude = 44.932500,longitude = 39.761111},
		["VEREVKIN"] = {latitude = 45.216944,longitude = 40.369167},
		["VERH.-PSHAP"] = {latitude = 42.890278,longitude = 41.163611},
		["VERH.BAKSAN"] = {latitude = 43.307500,longitude = 42.776944},
		["VERH.MARA"] = {latitude = 43.771667,longitude = 42.161389},
		["VERH.TEBERDA"] = {latitude = 43.536667,longitude = 41.804444},
		["VERHNE-ARMYANSKOELOO"] = {latitude = 43.739444,longitude = 39.631111},
		["VERHNE-IMERETINSKAYABUHTA"] = {latitude = 43.418056,longitude = 39.984722},
		["VERHNE-NIKOLAEVSKOE"] = {latitude = 43.530000,longitude = 39.943889},
		["VERHNE-VESELOE"] = {latitude = 43.426667,longitude = 39.993056},
		["VERHNEBAKANSKII"] = {latitude = 44.839444,longitude = 37.670556},
		["VERHNYAYAESHERA"] = {latitude = 43.076111,longitude = 40.908056},
		["VERHNYAYA-MTSARA"] = {latitude = 43.170000,longitude = 40.782778},
		["VERTKVICHALA"] = {latitude = 42.100000,longitude = 43.332222},
		["VERTKVILA"] = {latitude = 42.105278,longitude = 43.358889},
		["VESELOE"] = {latitude = 43.412778,longitude = 40.015556},
		["VESELOVKA"] = {latitude = 45.123333,longitude = 36.907778},
		["VESELYI"] = {latitude = 44.672778,longitude = 39.949167},
		["VESTNIK"] = {latitude = 45.096667,longitude = 37.459722},
		["VINOGRADNYI"] = {latitude = 45.049722,longitude = 37.328611},
		["VINSADY"] = {latitude = 44.081667,longitude = 42.991111},
		["VISHNEVKA"] = {latitude = 44.009444,longitude = 39.196389},
		["VITYAZEVO"] = {latitude = 44.992500,longitude = 37.280278},
		["VLADIMIROVKA"] = {latitude = 44.787500,longitude = 37.682500},
		["VOCHEPSHII"] = {latitude = 44.871667,longitude = 39.295000},
		["VOLKONKA"] = {latitude = 43.867778,longitude = 39.402778},
		["VOLKOVKA"] = {latitude = 43.697222,longitude = 39.676389},
		["VOLNAREVOLYUTSII"] = {latitude = 45.328056,longitude = 36.951944},
		["VORONEZHSKAYA"] = {latitude = 45.209444,longitude = 39.575000},
		["VORONTSOVKA"] = {latitude = 43.620556,longitude = 39.931667},
		["VORONTSOVSKAYA"] = {latitude = 45.215833,longitude = 38.745833},
		["VOSKRESENSKII"] = {latitude = 44.961111,longitude = 37.331944},
		["VOZDVIZHENSKAYA"] = {latitude = 45.126111,longitude = 40.159167},
		["VOZROZHDENIE"] = {latitude = 44.548333,longitude = 38.228611},
		["VPERED"] = {latitude = 44.545833,longitude = 39.714444},
		["VYSHESTEBLIEVSKAYA"] = {latitude = 45.189722,longitude = 37.005000},
		["VYSOTNYI"] = {latitude = 44.952500,longitude = 39.692500},
		["YABLONOVSKII"] = {latitude = 44.982500,longitude = 38.954167},
		["YUROVKA"] = {latitude = 45.110278,longitude = 37.422222},
		["YUZHNYI"] = {latitude = 45.025278,longitude = 38.086111},
		["ZAARNADZEEBI"] = {latitude = 42.251389,longitude = 43.037222},
		["ZAPADNYI"] = {latitude = 44.627500,longitude = 40.068889},
		["ZAPOROZHSKAYA"] = {latitude = 45.372500,longitude = 36.870000},
		["ZARAGULA"] = {latitude = 42.625278,longitude = 42.736944},
		["ZARATI"] = {latitude = 42.351667,longitude = 42.745556},
		["ZARECHNYI"] = {latitude = 44.754722,longitude = 39.845000},
		["ZAREVO"] = {latitude = 44.997778,longitude = 40.094444},
		["ZAROZHDENIE"] = {latitude = 45.154167,longitude = 39.243056},
		["ZARTSUPA"] = {latitude = 42.494722,longitude = 41.663056},
		["ZEDA-AHALSHENI"] = {latitude = 41.616944,longitude = 41.722778},
		["ZEDA-BAHVI"] = {latitude = 41.947778,longitude = 42.128611},
		["ZEDA-BERETISA"] = {latitude = 42.190556,longitude = 43.432222},
		["ZEDA-BZVANI"] = {latitude = 42.056667,longitude = 42.635556},
		["ZEDA-DAGVA"] = {latitude = 41.755833,longitude = 41.822500},
		["ZEDA-DIMI"] = {latitude = 42.069722,longitude = 42.863889},
		["ZEDA-DZIMITI"] = {latitude = 42.011667,longitude = 42.079722},
		["ZEDA-ETSERI"] = {latitude = 42.079444,longitude = 42.440000},
		["ZEDA-GORA"] = {latitude = 42.057778,longitude = 42.714444},
		["ZEDA-GORDI"] = {latitude = 42.454722,longitude = 42.548333},
		["ZEDA-ILEMI"] = {latitude = 42.062500,longitude = 43.143056},
		["ZEDA-KVEDA"] = {latitude = 42.336944,longitude = 43.519167},
		["ZEDA-LIA"] = {latitude = 42.674722,longitude = 42.044444},
		["ZEDA-MESHETI"] = {latitude = 42.218333,longitude = 42.681944},
		["ZEDA-MUKEDI"] = {latitude = 42.065556,longitude = 42.491111},
		["ZEDA-SAIRME"] = {latitude = 42.560556,longitude = 42.911667},
		["ZEDA-SAKARA"] = {latitude = 42.123056,longitude = 43.091667},
		["ZEDA-SAMEBA"] = {latitude = 41.791111,longitude = 41.876944},
		["ZEDA-SHAVRA"] = {latitude = 42.499722,longitude = 43.017500},
		["ZEDA-TSIHESULORI"] = {latitude = 42.085833,longitude = 42.525000},
		["ZEDA-TSIPLAVAKE"] = {latitude = 42.113889,longitude = 43.163889},
		["ZEDA-VANI"] = {latitude = 42.063611,longitude = 42.541111},
		["ZEDA-ZEGANI"] = {latitude = 42.035278,longitude = 42.946389},
		["ZEDUBANI"] = {latitude = 41.958611,longitude = 43.337222},
		["ZEINDARI"] = {latitude = 42.091667,longitude = 42.698333},
		["ZELENCHUKSKAYA"] = {latitude = 43.857500,longitude = 41.603333},
		["ZEMO-"] = {latitude = 42.518611,longitude = 43.331389},
		["ZEMO-AKETI"] = {latitude = 42.045000,longitude = 42.117778},
		["ZEMO-AZHARA"] = {latitude = 43.109722,longitude = 41.770833},
		["ZEMO-BIRTSHA"] = {latitude = 43.037778,longitude = 41.058333},
		["ZEMO-GUMURISHI"] = {latitude = 42.712222,longitude = 41.808056},
		["ZEMO-HUNTSI"] = {latitude = 42.406667,longitude = 42.449722},
		["ZEMO-MACHARA"] = {latitude = 43.007222,longitude = 41.203056},
		["ZEMO-MAKVANETI"] = {latitude = 41.897222,longitude = 42.056667},
		["ZEMO-NAGVAZAVO"] = {latitude = 42.383333,longitude = 42.371111},
		["ZEMO-NATANEBI"] = {latitude = 41.965000,longitude = 41.879444},
		["ZEMO-PARTSHMA"] = {latitude = 42.035278,longitude = 42.266667},
		["ZEMO-SHUHUTI"] = {latitude = 42.080556,longitude = 42.113889},
		["ZEMO-ZHOSHHA"] = {latitude = 42.583611,longitude = 42.980833},
		["ZENI"] = {latitude = 41.730833,longitude = 41.730833},
		["ZESTAFONI"] = {latitude = 42.102500,longitude = 43.060278},
		["ZEYUKO"] = {latitude = 44.118056,longitude = 41.851389},
		["ZHABNA"] = {latitude = 43.232500,longitude = 40.531111},
		["ZHELEZNYI"] = {latitude = 45.293889,longitude = 39.569722},
		["ZHINOTA"] = {latitude = 42.508611,longitude = 42.333333},
		["ZHONETI"] = {latitude = 42.368333,longitude = 42.727778},
		["ZNAKVA"] = {latitude = 42.514444,longitude = 43.108333},
		["ZNAMENKA"] = {latitude = 44.144167,longitude = 42.081944},
		["ZNAMENSKII"] = {latitude = 45.055278,longitude = 39.152500},
		["ZODI"] = {latitude = 42.341389,longitude = 43.357222},
		["ZOGISHI"] = {latitude = 42.551389,longitude = 42.868056},
		["ZOMLETI"] = {latitude = 42.034444,longitude = 42.158611},
		["ZOTI"] = {latitude = 41.892500,longitude = 42.466944},
		["ZOVRETI"] = {latitude = 42.179167,longitude = 43.065833},
		["ZUBI"] = {latitude = 42.396111,longitude = 42.032222},
		["ZUGDIDI"] = {latitude = 42.510833,longitude = 41.887222},
		["ZUMI"] = {latitude = 42.611389,longitude = 42.183333},
		["ZVARE"] = {latitude = 41.977222,longitude = 43.443056},
	}	
	--]]--
	
	-- nevada map town and cities locations
	local Nevada_towns = {
		["Strawberry Hill"] = { latitude = 37.619965, longitude = -114.513327},
		["Lovell"] = { latitude = 36.291359, longitude = -115.043058},
		["Victory Village"] = { latitude = 36.037199, longitude = -114.976103},
		["Warm Springs"] = { latitude = 38.190490, longitude = -116.370054},
		["Henderson"] = { latitude = 36.039146, longitude = -114.981924},
		["Baker"] = { latitude = 39.012177, longitude = -114.123326},
		["Scottys Junction"] = { latitude = 37.298820, longitude = -117.052848},
		["Majors Place"] = { latitude = 39.024944, longitude = -114.581950},
		["Volcano"] = { latitude = 38.118723, longitude = -116.908265},
		["Bracken"] = { latitude = 36.108915, longitude = -115.189151},
		["Hannapah"] = { latitude = 38.130741, longitude = -116.923027},
		["Cold Spring"] = { latitude = 37.751354, longitude = -114.424713},
		["Farrier"] = { latitude = 36.812748, longitude = -114.653881},
		["Lane City"] = { latitude = 39.260495, longitude = -114.931409},
		["Tule Springs"] = { latitude = 36.297317, longitude = -115.260856},
		["Tempiute"] = { latitude = 37.652452, longitude = -115.635865},
		["Centennial Hills"] = { latitude = 36.270423, longitude = -115.264929},
		["Mount Airy"] = { latitude = 39.503535, longitude = -117.379544},
		["Mack"] = { latitude = 35.977835, longitude = -115.172707},
		["Fish Island"] = { latitude = 36.457755, longitude = -114.346086},
		["Ridgebrook"] = { latitude = 36.124761, longitude = -115.333778},
		["Blair Junction"] = { latitude = 38.008341, longitude = -117.773649},
		["Forks Station"] = { latitude = 37.495766, longitude = -117.166185},
		["Mount Charleston"] = { latitude = 36.257191, longitude = -115.642799},
		["Mellan"] = { latitude = 37.712440, longitude = -116.594780},
		["Kingston Placer Mine"] = { latitude = 39.212429, longitude = -117.113422},
		["Mercury"] = { latitude = 36.660510, longitude = -115.994475},
		["Summerlin South"] = { latitude = 36.141031, longitude = -115.329198},
		["Foothills"] = { latitude = 36.050286, longitude = -114.949043},
		["East Las Vegas"] = { latitude = 36.094419, longitude = -115.041940},
		["Tuscany Residential Village"] = { latitude = 36.080446, longitude = -114.972675},
		["Ashton"] = { latitude = 36.720228, longitude = -116.672555},
		["Willow Grove"] = { latitude = 39.023271, longitude = -115.268914},
		["Lathrop Wells"] = { latitude = 36.643842, longitude = -116.400325},
		["Bard"] = { latitude = 35.987751, longitude = -115.237496},
		["Caselton"] = { latitude = 37.919130, longitude = -114.485271},
		["Duckwater"] = { latitude = 38.932432, longitude = -115.714485},
		["Lake Las Vegas"] = { latitude = 36.107874, longitude = -114.924442},
		["Calico Ridge"] = { latitude = 36.081107, longitude = -114.950406},
		["Central City"] = { latitude = 38.540419, longitude = -117.103527},
		["Palo Alto"] = { latitude = 38.556672, longitude = -117.146271},
		["Crystal"] = { latitude = 36.491623, longitude = -116.167536},
		["Washington"] = { latitude = 39.155206, longitude = -117.235091},
		["Winchester"] = { latitude = 36.129978, longitude = -115.118889},
		["Sunrise"] = { latitude = 36.188514, longitude = -115.062977},
		["Berlin"] = { latitude = 38.881871, longitude = -117.607602},
		["North Las Vegas"] = { latitude = 36.200837, longitude = -115.112096},
		["Keystone"] = { latitude = 38.444988, longitude = -116.382967},
		["Pigeon Spring"] = { latitude = 37.419988, longitude = -117.667523},
		["Ione"] = { latitude = 38.948260, longitude = -117.587601},
		["Palmetto"] = { latitude = 37.443808, longitude = -117.695976},
		["Nyala"] = { latitude = 38.248825, longitude = -115.728646},
		["Green Valley"] = { latitude = 36.048848, longitude = -115.080472},
		["Blair"] = { latitude = 37.792170, longitude = -117.649760},
		["Anthem"] = { latitude = 35.949582, longitude = -115.102098},
		["Middle Point Islands"] = { latitude = 36.153038, longitude = -114.454420},
		["Arden"] = { latitude = 36.018028, longitude = -115.230830},
		["Front Sight"] = { latitude = 36.010548, longitude = -115.860731},
		["Searchlight"] = { latitude = 35.465186, longitude = -114.919112},
		["Labbe Camp"] = { latitude = 36.450790, longitude = -116.056420},
		["Osceola"] = { latitude = 39.090500, longitude = -114.385556},
		["Valley View"] = { latitude = 38.068267, longitude = -117.224527},
		["Jackman"] = { latitude = 36.642195, longitude = -114.540263},
		["Springdale"] = { latitude = 37.029943, longitude = -116.755062},
		["Tokop"] = { latitude = 37.301596, longitude = -117.261185},
		["Dry Lake"] = { latitude = 36.455425, longitude = -114.847762},
		["Gemfield"] = { latitude = 37.739655, longitude = -117.295081},
		["Petersons Mill"] = { latitude = 39.557700, longitude = -117.432602},
		["Adverse"] = { latitude = 39.381328, longitude = -114.775572},
		["Green Springs"] = { latitude = 39.117155, longitude = -115.572537},
		["Nivloc"] = { latitude = 37.715486, longitude = -117.758984},
		["Laplace"] = { latitude = 37.086776, longitude = -116.025913},
		["Vegas Heights"] = { latitude = 36.199396, longitude = -115.156301},
		["Hadley"] = { latitude = 38.694376, longitude = -117.160364},
		["Joseco"] = { latitude = 37.501912, longitude = -114.229147},
		["Jean"] = { latitude = 35.779008, longitude = -115.324314},
		["Barcelona Summit"] = { latitude = 38.650766, longitude = -116.958136},
		["Crystal Springs"] = { latitude = 37.531627, longitude = -115.233910},
		["Lockes"] = { latitude = 38.554933, longitude = -115.775038},
		["Calumet"] = { latitude = 39.262995, longitude = -114.876685},
		["Amargosa Valley"] = { latitude = 36.494326, longitude = -116.424946},
		["Indian Cove"] = { latitude = 37.655243, longitude = -114.495271},
		["Montezuma"] = { latitude = 37.703821, longitude = -117.368972},
		["Rhyolite"] = { latitude = 36.903824, longitude = -116.828884},
		["Bonnie Claire"] = { latitude = 37.226597, longitude = -117.120904},
		["Kyle"] = { latitude = 37.314412, longitude = -114.490546},
		["Riverside"] = { latitude = 36.736085, longitude = -114.220527},
		["Copper Flat"] = { latitude = 39.261050, longitude = -114.988077},
		["Eunice Place"] = { latitude = 39.564095, longitude = -115.905333},
		["Downtown Henderson"] = { latitude = 36.031272, longitude = -114.981263},
		["West Spring"] = { latitude = 37.722155, longitude = -117.270636},
		["Sylvania"] = { latitude = 37.397987, longitude = -117.724255},
		["Flat Nose"] = { latitude = 37.893296, longitude = -114.300542},
		["Lida Junction"] = { latitude = 37.502322, longitude = -117.184597},
		["Ute"] = { latitude = 36.566082, longitude = -114.715551},
		["Preston"] = { latitude = 38.910951, longitude = -115.060691},
		["Stewart Mill"] = { latitude = 37.423600, longitude = -117.468525},
		["Hogum"] = { latitude = 39.056334, longitude = -114.411390},
		["Goldfield"] = { latitude = 37.708694, longitude = -117.236631},
		["Blue Diamond"] = { latitude = 36.046365, longitude = -115.403898},
		["Goodsprings"] = { latitude = 35.832609, longitude = -115.433981},
		["Riepetown"] = { latitude = 39.264383, longitude = -115.011689},
		["Gold Point"] = { latitude = 37.354653, longitude = -117.365077},
		["Florence Hill"] = { latitude = 37.707577, longitude = -117.220863},
		["Corn Creek"] = { latitude = 36.422854, longitude = -115.386428},
		["Canon City"] = { latitude = 39.456593, longitude = -117.129258},
		["Mountain's Edge"] = { latitude = 36.017276, longitude = -115.272118},
		["Enterprise"] = { latitude = 36.046711, longitude = -115.224557},
		["Shermantown"] = { latitude = 39.202711, longitude = -115.504480},
		["Amber"] = { latitude = 36.608029, longitude = -114.494149},
		["Horseshoe Bend"] = { latitude = 37.684134, longitude = -114.129425},
		["Hiko"] = { latitude = 37.596904, longitude = -115.224189},
		["Sunnyside"] = { latitude = 38.423284, longitude = -115.021124},
		["Chinatown"] = { latitude = 36.125976, longitude = -115.195989},
		["Paradise"] = { latitude = 36.115086, longitude = -115.173414},
		["Five Points"] = { latitude = 36.159098, longitude = -115.118228},
		["Bull Fork"] = { latitude = 39.073543, longitude = -115.767266},
		["Ely"] = { latitude = 39.247399, longitude = -114.890277},
		["Boyd"] = { latitude = 37.437743, longitude = -114.567217},
		["Overton"] = { latitude = 36.540734, longitude = -114.442989},
		["Angel Peak"] = { latitude = 36.318288, longitude = -115.584883},
		["Kimberly"] = { latitude = 39.263272, longitude = -115.022523},
		["Gold Center"] = { latitude = 36.868326, longitude = -116.766614},
		["Helene"] = { latitude = 37.481075, longitude = -114.776670},
		["Stewarts Point"] = { latitude = 36.380534, longitude = -114.407754},
		["Battleship Rock"] = { latitude = 36.118034, longitude = -114.733040},
		["Moapa"] = { latitude = 36.682189, longitude = -114.594147},
		["Black Island"] = { latitude = 36.103312, longitude = -114.778042},
		["Valley"] = { latitude = 36.274136, longitude = -115.071392},
		["Tybo"] = { latitude = 38.369934, longitude = -116.401168},
		["Big Trees"] = { latitude = 37.902741, longitude = -114.560552},
		["Gull Islands"] = { latitude = 36.273036, longitude = -114.383308},
		["Crescent Island"] = { latitude = 36.113033, longitude = -114.831655},
		["Desert Rock"] = { latitude = 36.627177, longitude = -116.020031},
		["Delamar"] = { latitude = 37.458020, longitude = -114.770003},
		["Boulder Islands"] = { latitude = 36.039702, longitude = -114.767762},
		["Eccles"] = { latitude = 37.615243, longitude = -114.431657},
		["Shoshone"] = { latitude = 38.848559, longitude = -114.407776},
		["Hot Springs"] = { latitude = 36.976889, longitude = -116.722838},
		["Pony Springs"] = { latitude = 38.318845, longitude = -114.606665},
		["Plutonium Valley"] = { latitude = 37.005821, longitude = -116.025618},
		["Eberhardt"] = { latitude = 39.194933, longitude = -115.480591},
		["Millett"] = { latitude = 39.015207, longitude = -117.180922},
		["Potosi"] = { latitude = 35.966940, longitude = -115.542111},
		["Morey"] = { latitude = 38.666600, longitude = -116.257001},
		["Placer Cove"] = { latitude = 35.705543, longitude = -114.706642},
		["Keystone Junction"] = { latitude = 39.282994, longitude = -114.963910},
		["Austin"] = { latitude = 39.493259, longitude = -117.069539},
		["Silver Peak"] = { latitude = 37.755278, longitude = -117.634177},
		["Mesquite"] = { latitude = 36.804009, longitude = -114.068059},
		["Spring Valley"] = { latitude = 36.111142, longitude = -115.242869},
		["Caliente"] = { latitude = 37.614965, longitude = -114.511938},
		["Old Camp"] = { latitude = 37.258263, longitude = -117.324796},
		["Pogonip"] = { latitude = 39.217988, longitude = -115.485313},
		["Stine"] = { latitude = 37.495242, longitude = -114.588885},
		["Glassand"] = { latitude = 36.556919, longitude = -114.464703},
		["Cactus Springs"] = { latitude = 36.577737, longitude = -115.727522},
		["Islen"] = { latitude = 37.529688, longitude = -114.321651},
		["Ash Springs"] = { latitude = 37.463051, longitude = -115.194211},
		["Bonnie Springs"] = { latitude = 36.059137, longitude = -115.453339},
		["Carvers"] = { latitude = 38.786598, longitude = -117.179254},
		["Hot Creek"] = { latitude = 38.385227, longitude = -115.151406},
		["Midway City"] = { latitude = 36.065587, longitude = -115.004889},
		["Sierra Vista City"] = { latitude = 36.060574, longitude = -115.006541},
		["Silverbow"] = { latitude = 37.887994, longitude = -116.491999},
		["Charleston Heights"] = { latitude = 36.166664, longitude = -115.232729},
		["Round Mountain"] = { latitude = 38.711574, longitude = -117.066021},
		["Inner Northwest"] = { latitude = 36.189735, longitude = -115.247664},
		["Reese River"] = { latitude = 38.997706, longitude = -117.470097},
		["Primm"] = { latitude = 35.611588, longitude = -115.385862},
		["Mission Hills"] = { latitude = 35.994793, longitude = -114.968469},
		["Echo Bay"] = { latitude = 36.309146, longitude = -114.427477},
		["Desert Shores"] = { latitude = 36.207674, longitude = -115.267662},
		["Sun City Summerlin"] = { latitude = 36.213422, longitude = -115.317787},
		["Acoma"] = { latitude = 37.548302, longitude = -114.172481},
		["McGill"] = { latitude = 39.405188, longitude = -114.778722},
		["Caselton Heights"] = { latitude = 37.913852, longitude = -114.479159},
		["Summerlin"] = { latitude = 36.191317, longitude = -115.301861},
		["Ruppes Place"] = { latitude = 38.754111, longitude = -115.060571},
		["Minerva"] = { latitude = 38.828282, longitude = -114.392219},
		["Rose Valley"] = { latitude = 37.938018, longitude = -114.252484},
		["Crows Nest"] = { latitude = 38.351603, longitude = -115.663366},
		["Ursine"] = { latitude = 37.984684, longitude = -114.215261},
		["Lida"] = { latitude = 37.458265, longitude = -117.498138},
		["Adaven"] = { latitude = 38.132166, longitude = -115.600309},
		["Stateline"] = { latitude = 37.296526, longitude = -117.406539},
		["Lund"] = { latitude = 38.858621, longitude = -115.007884},
		["Currant"] = { latitude = 38.742268, longitude = -115.473796},
		["Brown"] = { latitude = 37.607191, longitude = -114.132758},
		["Atlanta"] = { latitude = 38.465233, longitude = -114.331379},
		["Lavon"] = { latitude = 39.327717, longitude = -114.796683},
		["Canyon Gate"] = { latitude = 36.148785, longitude = -115.284743},
		["Siena"] = { latitude = 36.107982, longitude = -115.321934},
		["Galt"] = { latitude = 37.017470, longitude = -114.605826},
		["San Pedros"] = { latitude = 38.664655, longitude = -116.924246},
		["Cal-Nev-Ari"] = { latitude = 35.300440, longitude = -114.879304},
		["White Pine"] = { latitude = 39.529819, longitude = -114.889956},
		["Seven Hills"] = { latitude = 35.980531, longitude = -115.117204},
		["Ralston"] = { latitude = 37.556044, longitude = -117.152852},
		["Glendale"] = { latitude = 36.665250, longitude = -114.569154},
		["Cold Creek"] = { latitude = 36.413062, longitude = -115.742231},
		["Queensridge"] = { latitude = 36.161121, longitude = -115.302681},
		["Beatty"] = { latitude = 36.908422, longitude = -116.759275},
		["Ruby Hill"] = { latitude = 39.504651, longitude = -115.986169},
		["Manhattan"] = { latitude = 38.538661, longitude = -117.073950},
		["Mineral City"] = { latitude = 39.264383, longitude = -114.947798},
		["Johnnie"] = { latitude = 36.419974, longitude = -116.072087},
		["Kingston"] = { latitude = 39.208912, longitude = -117.074648},
		["Crossroads"] = { latitude = 37.565800, longitude = -114.256093},
		["Arrolime"] = { latitude = 36.351360, longitude = -114.909166},
		["Garnet"] = { latitude = 36.388582, longitude = -114.871110},
		["Apex"] = { latitude = 36.329138, longitude = -114.927777},
		["Bunkerville"] = { latitude = 36.771772, longitude = -114.126766},
		["Weepah"] = { latitude = 37.930364, longitude = -117.559229},
		["Montezuma Wells"] = { latitude = 38.171876, longitude = -117.416481},
		["Carp"] = { latitude = 37.111915, longitude = -114.492767},
		["Rox"] = { latitude = 36.880803, longitude = -114.667216},
		["Sandy Valley"] = { latitude = 35.816923, longitude = -115.632233},
		["Ruth"] = { latitude = 39.280544, longitude = -114.985366},
		["Sandy Mill"] = { latitude = 35.804142, longitude = -115.605005},
		["Alkali"] = { latitude = 37.823922, longitude = -117.333900},
		["Wann"] = { latitude = 36.233303, longitude = -115.113336},
		["Panaca"] = { latitude = 37.790520, longitude = -114.389434},
		["Moapa Valley"] = { latitude = 36.580531, longitude = -114.470268},
		["Grant Canyon"] = { latitude = 38.419020, longitude = -115.526228},
		["Dome Mountain"] = { latitude = 37.007357, longitude = -116.312331},
		["Calico Basin"] = { latitude = 36.150689, longitude = -115.419029},
		["Shoshone Mountain"] = { latitude = 36.995315, longitude = -116.213760},
		["Sloan"] = { latitude = 35.941234, longitude = -115.216500},
		["Barclay"] = { latitude = 37.513300, longitude = -114.251647},
		["Logandale"] = { latitude = 36.596637, longitude = -114.484155},
		["Trout Canyon"] = { latitude = 36.181736, longitude = -115.679231},
		["Yucca Pass"] = { latitude = 36.933060, longitude = -116.051728},
		["Eastland Heights"] = { latitude = 36.192191, longitude = -115.188058},
		["Tonopah"] = { latitude = 38.068101, longitude = -117.230950},
		["Steptoe"] = { latitude = 39.406883, longitude = -114.763905},
		["Farmer Station"] = { latitude = 37.251043, longitude = -117.003959},
		["Esmeralda"] = { latitude = 37.806669, longitude = -117.641924},
		["Lincoln"] = { latitude = 37.544948, longitude = -114.876445},
		["Yankee Blade"] = { latitude = 39.531870, longitude = -117.051201},
		["Dike"] = { latitude = 36.301359, longitude = -115.013336},
		["Nye"] = { latitude = 38.354484, longitude = -116.406962},
		["Boulder City"] = { latitude = 35.978591, longitude = -114.832485},
		["Crestline"] = { latitude = 37.663579, longitude = -114.126092},
		["Hamilton"] = { latitude = 39.252988, longitude = -115.486425},
		["McLeans"] = { latitude = 38.047709, longitude = -117.652041},
		["Mountain Springs"] = { latitude = 36.018304, longitude = -115.506990},
		["Sand Island"] = { latitude = 36.110255, longitude = -114.818322},
		["Las Vegas"] = { latitude = 36.166286, longitude = -115.149225},
		["Saddle Island"] = { latitude = 36.069145, longitude = -114.801097},
		["Douglas"] = { latitude = 38.854386, longitude = -115.144464},
		["Juan"] = { latitude = 35.366533, longitude = -115.085038},
		["Sentinel Island"] = { latitude = 36.056647, longitude = -114.744984},
		["Golden Arrow"] = { latitude = 37.997714, longitude = -116.606169},
		["Alamo"] = { latitude = 37.364961, longitude = -115.164461},
		["Prince"] = { latitude = 37.899963, longitude = -114.474159},
		["Keystone"] = { latitude = 39.281883, longitude = -114.968355},
		["Etna"] = { latitude = 37.555242, longitude = -114.571385},
		["Grantsville"] = { latitude = 38.845483, longitude = -117.573156},
		["Sundown"] = { latitude = 37.635081, longitude = -115.806882},
		["Palm Gardens"] = { latitude = 35.198359, longitude = -114.856716},
		["Pahrump"] = { latitude = 36.208301, longitude = -115.983913},
		["Baltimore Mill"] = { latitude = 39.284384, longitude = -114.868907},
		["Angle City"] = { latitude = 37.043303, longitude = -114.588325},
		["Laughlin"] = { latitude = 35.167777, longitude = -114.573021},
		["Eureka"] = { latitude = 39.512490, longitude = -115.960885},
		["Pioche"] = { latitude = 37.929685, longitude = -114.452214},
		["Millers"] = { latitude = 38.130504, longitude = -117.458401},
		["Whitney"] = { latitude = 36.088532, longitude = -115.037213},
		["Darroughs Hot Springs"] = { latitude = 38.820209, longitude = -117.180643},
		["Hoya"] = { latitude = 36.946914, longitude = -114.652216},
		["Pyramid Island"] = { latitude = 36.051646, longitude = -114.802208},
		["Ripley"] = { latitude = 35.798031, longitude = -115.601671},
		["East Ely"] = { latitude = 39.253106, longitude = -114.866850},
		["Bristol"] = { latitude = 38.079960, longitude = -114.619443},
		["Belmont"] = { latitude = 38.596044, longitude = -116.874244},
		["Indian Springs"] = { latitude = 36.569677, longitude = -115.670571},
		["Mud Springs"] = { latitude = 38.279960, longitude = -114.135537},
		["Steigmeyer Mill"] = { latitude = 38.731941, longitude = -117.059737},
		["Boulder Junction"] = { latitude = 36.081083, longitude = -115.198054},
		["Mendha"] = { latitude = 37.956074, longitude = -114.514439},
		["Manse"] = { latitude = 36.155165, longitude = -115.902679},
		["Torino Ranch"] = { latitude = 36.168451, longitude = -115.578663},
		["San Carlos"] = { latitude = 37.346010, longitude = -117.124039},
		["Union"] = { latitude = 38.871871, longitude = -117.598991},
		["Ninemile Rocks"] = { latitude = 37.782465, longitude = -114.225539},
		["Nelson"] = { latitude = 35.708042, longitude = -114.824701},
		["Rachel"] = { latitude = 37.644333, longitude = -115.744743},
		["Elgin"] = { latitude = 37.351911, longitude = -114.535826},
		["Mosier"] = { latitude = 39.260495, longitude = -114.826961},
		["Pine Valley"] = { latitude = 37.391052, longitude = -113.514061},
		["Newhouse"] = { latitude = 38.481071, longitude = -113.341910},
		["Gramse"] = { latitude = 38.790522, longitude = -112.042983},
		["Ibex"] = { latitude = 38.882454, longitude = -113.441915},
		["Green Springs"] = { latitude = 37.139958, longitude = -113.527589},
		["Veyo"] = { latitude = 37.338034, longitude = -113.693019},
		["Meadow"] = { latitude = 38.885798, longitude = -112.410494},
		["Hamlin Valley"] = { latitude = 37.998295, longitude = -113.969695},
		["Holden"] = { latitude = 39.098851, longitude = -112.270771},
		["Green Valley"] = { latitude = 37.105265, longitude = -113.621155},
		["Van"] = { latitude = 39.230513, longitude = -112.668560},
		["Circleville"] = { latitude = 38.171645, longitude = -112.270482},
		["Kanosh"] = { latitude = 38.801356, longitude = -112.437439},
		["Virgin"] = { latitude = 37.208316, longitude = -113.188279},
		["Newcastle"] = { latitude = 37.666641, longitude = -113.549406},
		["Pintura"] = { latitude = 37.340815, longitude = -113.274116},
		["Deseret"] = { latitude = 39.286901, longitude = -112.652727},
		["Harrisburg Junction"] = { latitude = 37.161927, longitude = -113.431618},
		["Sugarville"] = { latitude = 39.464590, longitude = -112.653144},
		["Kingston"] = { latitude = 38.208313, longitude = -112.187702},
		["Monroe"] = { latitude = 38.629972, longitude = -112.120757},
		["Zane"] = { latitude = 37.925247, longitude = -113.583300},
		["Nibley"] = { latitude = 38.687192, longitude = -112.122426},
		["Joseph"] = { latitude = 38.626361, longitude = -112.217150},
		["Desert Mound"] = { latitude = 37.710531, longitude = -113.273566},
		["Hildale"] = { latitude = 37.003595, longitude = -112.966881},
		["St. George"] = { latitude = 37.104153, longitude = -113.584131},
		["Orderville"] = { latitude = 37.275985, longitude = -112.638689},
		["Eskdale"] = { latitude = 39.107169, longitude = -113.952488},
		["Cove"] = { latitude = 38.594695, longitude = -112.249372},
		["Borden"] = { latitude = 38.981628, longitude = -112.794672},
		["Spry"] = { latitude = 38.021644, longitude = -112.364095},
		["Beryl Junction"] = { latitude = 37.709417, longitude = -113.656077},
		["Elsinore"] = { latitude = 38.683084, longitude = -112.148275},
		["Sigurd"] = { latitude = 38.840521, longitude = -111.967704},
		["Smyths"] = { latitude = 38.563853, longitude = -112.991067},
		["Junction"] = { latitude = 38.237479, longitude = -112.219925},
		["Lower Kimberly"] = { latitude = 38.490251, longitude = -112.390764},
		["North View"] = { latitude = 37.657417, longitude = -112.834293},
		["Coral Canyon"] = { latitude = 37.156942, longitude = -113.454613},
		["Shem"] = { latitude = 37.191645, longitude = -113.768854},
		["Tortoise and Hare Trailer Court"] = { latitude = 37.293317, longitude = -112.617154},
		["Cedar City"] = { latitude = 37.677477, longitude = -113.061893},
		["Hamiltons Fort"] = { latitude = 37.628407, longitude = -113.131714},
		["Halivah"] = { latitude = 37.710532, longitude = -113.174952},
		["Washington Fields"] = { latitude = 37.097612, longitude = -113.511290},
		["Little Valley"] = { latitude = 37.063157, longitude = -113.537139},
		["Cook Corner"] = { latitude = 38.294968, longitude = -113.047456},
		["Shunesburg"] = { latitude = 37.158039, longitude = -112.977717},
		["Minersville"] = { latitude = 38.214136, longitude = -112.923562},
		["Grafton Ghosttown"] = { latitude = 37.167205, longitude = -113.079942},
		["Middleton"] = { latitude = 37.114426, longitude = -113.536624},
		["Watchman Residential Area"] = { latitude = 37.203316, longitude = -112.979940},
		["Manderfield"] = { latitude = 38.359415, longitude = -112.638830},
		["Bloomington"] = { latitude = 37.046649, longitude = -113.606073},
		["Kanosh Indian Village"] = { latitude = 38.819967, longitude = -112.403827},
		["Hinckley"] = { latitude = 39.324955, longitude = -112.671061},
		["Anderson Junction"] = { latitude = 37.284149, longitude = -113.305505},
		["Oak City"] = { latitude = 39.374788, longitude = -112.335844},
		["Venice"] = { latitude = 38.800244, longitude = -112.006315},
		["Lund"] = { latitude = 38.007469, longitude = -113.431631},
		["Prattsville"] = { latitude = 38.774134, longitude = -112.014648},
		["Beaver"] = { latitude = 38.276531, longitude = -112.640279},
		["Lake View Resort"] = { latitude = 37.716089, longitude = -112.622159},
		["Brian Head"] = { latitude = 37.692755, longitude = -112.850777},
		["Gunlock"] = { latitude = 37.286089, longitude = -113.763299},
		["Tropic Canyon"] = { latitude = 37.681151, longitude = -112.130356},
		["Glendale"] = { latitude = 37.317761, longitude = -112.597154},
		["Enterprise"] = { latitude = 37.573587, longitude = -113.719133},
		["Old Irontown"] = { latitude = 37.601583, longitude = -113.445124},
		["Hillsdale"] = { latitude = 37.719146, longitude = -112.382150},
		["Sevier"] = { latitude = 38.586362, longitude = -112.258261},
		["Central Valley"] = { latitude = 38.703859, longitude = -112.098815},
		["Strong"] = { latitude = 39.434676, longitude = -112.469946},
		["Murdock"] = { latitude = 38.503576, longitude = -112.984122},
		["Dixie Downs"] = { latitude = 37.131873, longitude = -113.624103},
		["Gandy"] = { latitude = 39.449944, longitude = -113.983049},
		["Kanab"] = { latitude = 37.048172, longitude = -112.526795},
		["Virgin Territory Trailer Park"] = { latitude = 37.207761, longitude = -113.271892},
		["Mills"] = { latitude = 39.482734, longitude = -112.027989},
		["Silver Reef"] = { latitude = 37.252760, longitude = -113.367728},
		["Springdale"] = { latitude = 37.188871, longitude = -112.998551},
		["Sulphurdale"] = { latitude = 38.560248, longitude = -112.581885},
		["Annabella"] = { latitude = 38.709136, longitude = -112.059925},
		["Bloom"] = { latitude = 38.933573, longitude = -112.808839},
		["Beryl"] = { latitude = 37.895637, longitude = -113.662045},
		["Alunite"] = { latitude = 38.379143, longitude = -112.246592},
		["Glenwood"] = { latitude = 38.763301, longitude = -111.990202},
		["Thermo"] = { latitude = 38.214412, longitude = -113.171626},
		["Red Point"] = { latitude = 39.428291, longitude = -112.035489},
		["Hatton"] = { latitude = 38.838855, longitude = -112.456606},
		["Read"] = { latitude = 38.572464, longitude = -112.984956},
		["Yale Crossing"] = { latitude = 37.864968, longitude = -113.748858},
		["Avon"] = { latitude = 37.894138, longitude = -113.349960},
		["Kema"] = { latitude = 38.803855, longitude = -112.024927},
		["Washington"] = { latitude = 37.130537, longitude = -113.508287},
		["Summit"] = { latitude = 37.801175, longitude = -112.936333},
		["Fillmore"] = { latitude = 38.968852, longitude = -112.323549},
		["Panguitch"] = { latitude = 37.822755, longitude = -112.435764},
		["Navajo lake Lodge"] = { latitude = 37.522473, longitude = -112.798690},
		["Milford"] = { latitude = 38.396911, longitude = -113.010789},
		["Sixmile Point"] = { latitude = 38.771634, longitude = -112.520497},
		["Shivwits"] = { latitude = 37.181090, longitude = -113.757465},
		["Burbank"] = { latitude = 38.821185, longitude = -113.991202},
		["Belknap"] = { latitude = 38.514974, longitude = -112.263537},
		["Yellow Banks"] = { latitude = 38.424966, longitude = -112.988567},
		["Shenendoah City"] = { latitude = 38.352187, longitude = -113.137182},
		["Delta"] = { latitude = 39.352178, longitude = -112.577170},
		["Iron Mountain"] = { latitude = 37.611349, longitude = -113.395083},
		["Eightmile Point"] = { latitude = 38.757467, longitude = -112.551331},
		["Big Plain Junction"] = { latitude = 37.048873, longitude = -113.106609},
		["Maple Grove"] = { latitude = 39.014961, longitude = -112.092989},
		["La Verkin"] = { latitude = 37.201094, longitude = -113.269670},
		["Bullion Falls"] = { latitude = 38.409697, longitude = -112.338540},
		["Upper Kimberly"] = { latitude = 38.485528, longitude = -112.397154},
		["Bloomington Hills"] = { latitude = 37.060260, longitude = -113.556068},
		["Iron Basin"] = { latitude = 38.930237, longitude = -112.955232},
		["Hurricane"] = { latitude = 37.175889, longitude = -113.292960},
		["Scipio"] = { latitude = 39.244960, longitude = -112.104102},
		["Tropic"] = { latitude = 37.625261, longitude = -112.082136},
		["Paragonah"] = { latitude = 37.885808, longitude = -112.775221},
		["Bryce Canyon City"] = { latitude = 37.673959, longitude = -112.156418},
		["Bone Valley"] = { latitude = 38.125531, longitude = -112.402709},
		["Oak Creek Residential Area"] = { latitude = 37.210538, longitude = -112.987163},
		["Apple Valley"] = { latitude = 37.089706, longitude = -113.124388},
		["Greenville"] = { latitude = 38.254415, longitude = -112.712443},
		["Harrisburg"] = { latitude = 37.205760, longitude = -113.394050},
		["Duck Creek Village"] = { latitude = 37.523591, longitude = -112.662992},
		["Oasis"] = { latitude = 39.293845, longitude = -112.628282},
		["Cunningham Hill"] = { latitude = 38.396081, longitude = -112.724946},
		["Sutherland"] = { latitude = 39.388843, longitude = -112.633561},
		["Garrison"] = { latitude = 38.934393, longitude = -114.033043},
		["Santa Clara"] = { latitude = 37.133036, longitude = -113.654127},
		["Rockville"] = { latitude = 37.161094, longitude = -113.038275},
		["Toquerville"] = { latitude = 37.253316, longitude = -113.284671},
		["Motoqua"] = { latitude = 37.303865, longitude = -113.999697},
		["Long Valley Junction"] = { latitude = 37.488037, longitude = -112.511321},
		["Greenwood"] = { latitude = 39.122461, longitude = -112.352717},
		["Alton"] = { latitude = 37.438941, longitude = -112.483925},
		["Upton"] = { latitude = 38.324133, longitude = -113.066346},
		["Adamsville"] = { latitude = 38.258303, longitude = -112.793835},
		["Malone"] = { latitude = 38.652740, longitude = -112.981900},
		["Jensen"] = { latitude = 38.723580, longitude = -112.098538},
		["Clear Lake"] = { latitude = 39.118293, longitude = -112.737450},
		["Flowell"] = { latitude = 38.979130, longitude = -112.428552},
		["Mount Carmel"] = { latitude = 37.247206, longitude = -112.664377},
		["Wheatgrass"] = { latitude = 37.971917, longitude = -112.793555},
		["Richfield"] = { latitude = 38.772467, longitude = -112.084094},
		["Laho"] = { latitude = 38.265245, longitude = -113.115792},
		["Juniper Park Resort"] = { latitude = 37.713311, longitude = -112.622437},
		["Heist"] = { latitude = 37.853447, longitude = -113.846074},
		["Ivins"] = { latitude = 37.168591, longitude = -113.679406},
		["Parowan"] = { latitude = 37.842197, longitude = -112.828000},
		["Fort Johnson"] = { latitude = 37.779143, longitude = -113.032171},
		["Thompsonville"] = { latitude = 38.416921, longitude = -112.216591},
		["Central"] = { latitude = 37.416645, longitude = -113.624405},
		["North Creek"] = { latitude = 38.337193, longitude = -112.577994},
		["Hoovers"] = { latitude = 38.504142, longitude = -112.257703},
		["Pittsburg"] = { latitude = 38.505253, longitude = -112.259370},
		["Mount Carmel Junction"] = { latitude = 37.223554, longitude = -112.681233},
		["Frisco"] = { latitude = 38.459532, longitude = -113.254467},
		["Marysvale"] = { latitude = 38.449420, longitude = -112.230202},
		["Abraham"] = { latitude = 39.396620, longitude = -112.718008},
		["Hatch"] = { latitude = 37.649702, longitude = -112.434374},
		["Iron Springs"] = { latitude = 37.749697, longitude = -113.234676},
		["Bear Valley Junction"] = { latitude = 37.965254, longitude = -112.412430},
		["Blueacre"] = { latitude = 38.485240, longitude = -113.131905},
		["McCornick"] = { latitude = 39.215515, longitude = -112.408275},
		["Enoch"] = { latitude = 37.773310, longitude = -113.024393},
		["Kanarraville"] = { latitude = 37.537096, longitude = -113.183501},
		["Shauntie"] = { latitude = 38.341076, longitude = -113.166627},
		["Neels"] = { latitude = 39.044960, longitude = -112.769394},
		["Modena"] = { latitude = 37.798856, longitude = -113.924141},
		["Latimer"] = { latitude = 38.100246, longitude = -113.315796},
		["Harding"] = { latitude = 39.289125, longitude = -112.464111},
		["Nellis AFB"] = { latitude = 36.240329, longitude = -115.045146},
		["Creech AFB"] = { latitude = 36.580612, longitude = -115.674929},
		["Area 51"] = { latitude = 37.243011, longitude = -115.808955},
		["McCarran Airport"] = { latitude = 36.082081, longitude = -115.150024},
		["Cottonwood Island"] = { latitude = 35.491453, longitude = -114.684390},
	}
	--]]--
	
	-- Strait of Hormuz map town and cities locations
	local SoH_towns = {
	}
	--]]--		

	



	
	--#####################################################		
	--### static tables  ##################################
	--#####################################################	

	-- define existent risk level
	
	--used for now
	local ARL = "medium"	
	

	-- table of missionType. Editing this will allow to influence the AVIAREQ document and the ground mission planning. It's strictly linked to decisionMaker function.
	GroundMissionType =
	{
		["A"] =
		{
			["Action"] = "Movement to Contact",
			["Description"] = "UNIT IS MOVING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG TILL VISUAL CONTACT WITH HOSTILE OR AREA SECURITY IS ARCHIEVED.",
			["AskSupport"] = 1,
			["Type"] = "neutral",
			["SumCode"] = "CONVOY SECURITY",
			["Function"] = "CmdMTC",
			["Movement"] = true,
			["Priority"] = 3,
		},
		["B"] =
		{
			["Action"] = "Attack and occupy",
			["Description"] = "UNIT IS MOVING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG TO OCCUPY AND SECURE TERRITORY.",
			["AskSupport"] = 2,
			["Type"] = "offensive",
			["SumCode"] = "CAS",
			["Function"] = "CmdMTA",
			["Movement"] = true,
			["Priority"] = 3,
		},
		["C"] =
		{
			["Action"] = "Advance 5 km",
			["Description"] = "UNIT IS MOVING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG FOR 5 CLICKS. ATTRITION OF HOSTILE ASSETS IN THE TARGET AREA IS ADVISABLE.",
			["AskSupport"] = 4,
			["Type"] = "offensive",
			["SumCode"] = "BAI",
			["Function"] = "Cmd5click",
			["Movement"] = true,
			["Priority"] = 3,
		},
		["D"] =
		{
			["Action"] = "Retreat",
			["Description"] = "UNIT IS RETREATING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG. AS INTEL REPORTS, OUR FORCES ARE IN SEVERE DISADVANTAGE. AIR SUPPORT IS REQUESTED TO ATTRITE AND SLOW DOWN HOSTILE FORCES.",
			["AskSupport"] = 5,
			["Type"] = "defensive",
			["SumCode"] = "CAS",
			["Function"] = "CmdRTR",
			["Movement"] = true,
			["Priority"] = 5,
		},
		["E"] =
		{
			["Action"] = "Withdraw till break LOS",
			["Description"] = "UNIT IS WITHDRAWING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG TILL HOSTILES BREAK LOS. AIR SUPPORT MAY BE ADVISABLE TO SLOW DOWN OR ATTRITE HOSTILE FORCES.",
			["AskSupport"] = 1,
			["Type"] = "defensive",
			["SumCode"] = "CAS",
			["Function"] = "CmdBrkLOS",
			["Movement"] = true,
			["Priority"] = 4,
		},
		["F"] =
		{
			["Action"] = "Stay there and cover",
			["Description"] = "UNIT IS HOLDING POSITION in ToTERRname, ToTERRpointLAT, ToTERRpointLONG. HOSTILE ASSETS IN THE PROXIMITY AREAS PREVENT AN ADVANCE DUE TO HIGH RISKS OF SEVERE LOSSES.",
			["AskSupport"] = 2,
			["Type"] = "defensive",
			["SumCode"] = "BAI",
			["Function"] = "No Func",
			["Movement"] = false,
			["Priority"] = 1,
		},
		["G"] =
		{
			["Action"] = "Withdraw till break LOS, enemy has range fire superiority",
			["Description"] = "UNIT IS WITHDRAWING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG TILL HOSTILES BREAK LOS. AS INTEL REPORTS, OUR FORCES ARE IN A SEVERE RANGE FIRE DISADVANTAGE. AIR SUPPORT IS ADVISABLE TO ATTRIT ENEMY ATGM AND ARTILLERY UNITS.",
			["AskSupport"] = 3,
			["Type"] = "defensive",
			["SumCode"] = "CAS",
			["Function"] = "CmdBrkLOS",
			["Movement"] = true,
			["Priority"] = 4,
		},
		["H"] =
		{
			["Action"] = "Advance 5 km, range fire advantage",
			["Description"] = "UNIT IS MOVING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG FOR 5 CLICKS. AS INTEL REPORTS, OUR FORCES ARE IN RANGED FIRE ADVANTAGE. ATTRITION OF HOSTILE ASSETS IN THE TARGET AREA IS WELCOME TO REDUCE RISKS.",
			["AskSupport"] = 2,
			["Type"] = "offensive",
			["SumCode"] = "BAI",
			["Function"] = "Cmd5click",
			["Movement"] = true,
			["Priority"] = 3,
		},
		["I"] =
		{
			["Action"] = "Repositioning in same territory",
			["Description"] = "UNIT IS REPOSITIONING IN ToTERRname, ToTERRpointLAT, ToTERRpointLONG.",
			["AskSupport"] = 2,
			["Type"] = "neutral",
			["SumCode"] = "CAS",
			["Function"] = "CmdMTA",
			["Movement"] = true,
			["Priority"] = 1,
		},
		["J"] =
		{
			["Action"] = "Presidiate allied territory",
			["Description"] = "UNIT IS MOVING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG TO KEEP SECURED THE AREA.",
			["AskSupport"] = 2,
			["Type"] = "neutral",
			["SumCode"] = "CONVOY SECURITY",
			["Function"] = "CmdMTA",
			["Movement"] = true,
			["Priority"] = 2,
		},
		["K"] =
		{
			["Action"] = "Relocating in another territory",
			["Description"] = "UNIT IS BEING RELOCATED, MOVING FROM FromTERRname, FromTERRpointLAT, FromTERRpointLONG TO ToTERRname, ToTERRpointLAT, ToTERRpointLONG",
			["AskSupport"] = 1,
			["Type"] = "neutral",
			["SumCode"] = "CONVOY SECURITY",
			["Function"] = "CmdMTA",
			["Movement"] = true,
			["Priority"] = 2,
		},
	}
	--]]--


	--#####################################################		
	--### dynamic tables  #################################
	--#####################################################			
	
	local indexUnits = {}-- USED INTEL
	
	local INTELtable = {}
	local TERRtable = {}
	local ORBATtable = {}
	local SITREPtable = {} -- maybe rebuilt from mission file for future possible improvement
	local PLANtable = {}
	

	
	--#####################################################		
	--### those are the stop movement functions ###########
	--#####################################################
	
	--this function check terrain LOS between a any units of a group named "groupXname" and ANY enemy vehicle units: if there is LOS within defined "range", command an hold.
	local StopMovLOSwEnemy = function(dataTable) -- OK			
		local GroupId = nil
		local range = nil
		local DestPos = nil
		local GroupTable = nil
		if type(dataTable) == "table" then
			GroupId = dataTable.GroupId
			range = dataTable.Range
			DestPos = dataTable.Pos
			GroupTable = dataTable.Table
		end
		local taskDone = false
		local TargetsTable = GroupTable:getController():getDetectedTargets()
		if table.getn(TargetsTable) > 0 then
			trigger.action.groupStopMoving(GroupTable)
			taskDone = true
			if debugProcess == true or debugProcessPLAN == true then
				env.info(("DAWS AIE  -  ExeMission, StopMovLOSwEnemy - Group: " .. tostring(GroupTable:getName()) .. ", Task completed: LOS with enemy"))
			end
			for pId, pData in pairs(PLANtable) do
				if pData.id == GroupId then
					table.remove(PLANtable,pId)
				end
			end					
		end
	
		if taskDone == false then
			for _,unitData in pairs(mist.DBs.aliveUnits) do
				if GroupId and unitData.groupId == GroupId then
					local OwnCoalition = unitData.coalition
					local OwnName = unitData.unitName
					local OwnData = Unit.getByName(OwnName)
					local OwnX = unitData.pos.x
					local OwnZ = unitData.pos.z
					local OwnY = unitData.pos.y+2
					local OwnGroup = OwnData:getGroup()
					local OwnGroupName = OwnGroup:getName()
					local OwnPos = {
										x = OwnX,
										y = OwnY,
										z = OwnZ
									}	
					if mist.utils.get3DDist(OwnPos,DestPos) < 1000 then					
						for pId, pData in pairs(PLANtable) do
							if pData.id == GroupId then
								table.remove(PLANtable,pId)
							end
						end
						trigger.action.groupStopMoving(OwnGroup)
						taskDone = true
						if debugProcess == true or debugProcessPLAN == true then
							env.info(("DAWS AIE  -  ExeMission, StopMovLOSwEnemy - Group: " .. tostring(GroupTable:getName()) .. ", Task completed. PLAN entry removed"))
						end						
					end			
				end
			end
		end

		local taskIsThere = false
		for pId, pData in pairs(PLANtable) do
			if pData.id == GroupId then
				taskIsThere = true
			end
		end			
		
		if taskDone == false and taskIsThere == true then		
			timer.scheduleFunction(StopMovLOSwEnemy,{GroupId = GroupId, Range = range, Pos = DestPos, Table = GroupTable}, timer.getTime()+30)
		end
	end		
	

	--this function calculate linear horizontal distance between a group initial position and the actual group position using the mist aliveunits db at every call. If at the call the distance is more than "range", it stops the group.
	local StopMovFixDistance = function(dataTable) -- OK			
		local GroupId = nil
		local range = nil
		local DestPos = nil
		if type(dataTable) == "table" then
			GroupId = dataTable.GroupId
			range = dataTable.Range
			DestPos = dataTable.Pos
			GroupTable = dataTable.Table				
		end
		
		if debugProcess == true or debugProcessPLAN == true then
			env.info(("DAWS AIE  -  ExeMission, StopMovFixDistance started for group: " .. tostring(GroupId)))
		end
		local taskDone = false
		local unitFound = false
		for _,unitData in pairs(mist.DBs.aliveUnits) do
			if GroupId and unitData.groupId == GroupId and unitFound == false and taskDone == false then
				unitFound = true
				local OwnCoalition = unitData.coalition
				local OwnName = unitData.unitName
				local OwnData = Unit.getByName(OwnName)
				local OwnX = unitData.pos.x
				local OwnZ = unitData.pos.z
				local OwnY = unitData.pos.y+2
				local OwnGroup = OwnData:getGroup()
				local OwnGroupName = OwnGroup:getName()
				local OwnPos = {
									x = OwnX,
									y = OwnY,
									z = OwnZ
								}
				local OwnInitX = unitData.point.x
				local OwnInitZ = unitData.point.y
				local OwnInitPos = {
									x = OwnInitX,
									y = 0,
									z = OwnInitZ
								}	
				
				if mist.utils.get3DDist(OwnPos,OwnInitPos) > range then
					trigger.action.groupStopMoving(OwnGroup)
					if debugProcess == true or debugProcessPLAN == true then
						env.info(("DAWS AIE  -  ExeMission, StopMovFixDistance - Group: " .. tostring(GroupTable:getName()) .. ", Task completed: reached max distance"))
					end						
					for pId, pData in pairs(PLANtable) do
						if pData.id == groupXid then
							table.remove(PLANtable,pId)
						end
					end
					taskDone = true
				end

				if mist.utils.get3DDist(OwnPos,DestPos) < 1000 then					
					for pId, pData in pairs(PLANtable) do
						if pData.id == GroupId then
							table.remove(PLANtable,pId)
						end
					end					
					taskDone = true
					if debugProcess == true or debugProcessPLAN == true then
						env.info(("DAWS AIE  -  ExeMission, StopMovFixDistance - Group: " .. tostring(GroupTable:getName()) .. ", Task completed: reached destination"))
					end						
				end
			end
		end

		local taskIsThere = false
		for pId, pData in pairs(PLANtable) do
			if pData.id == GroupId then
				taskIsThere = true
			end
		end
		
		if taskDone == false and taskIsThere == true then		
			timer.scheduleFunction(StopMovFixDistance,{GroupId = GroupId, Range = range, Pos = DestPos}, timer.getTime()+30)
		end
		
	end		
	--]]--		
	

	--#####################################################		
	--### local sub functions  ############################
	--#####################################################		

	local evaluateStrenght = function(unitDesc) -- unitDesc can be a description table or a unit type name in DCS database (i.e. "BTR-80")
		
		if type(unitDesc) ~= 'table' then
			local tunitDesc = unitDesc
			unitDesc = Unit.getDescByName(tunitDesc)
		end	
			
		-- define starting life value
		local Strenght = unitDesc.life
		
		local ArmorFactor = 0
		--[[ define armor factor addition -- REMOVED: already in life value.
		if unitDesc.attributes.HeavyArmoredUnits and unitDesc.attributes.HeavyArmoredUnits == true then
			ArmorFactor = 10
		elseif unitDesc.attributes.LightArmoredUnits and unitDesc.attributes.LightArmoredUnits == true then
			ArmorFactor = 5								
		elseif unitDesc.attributes.NonArmoredUnits and unitDesc.attributes.NonArmoredUnits == true then
			ArmorFactor = 2				
		end
		--]]--
		Strenght = Strenght + ArmorFactor
		
		local AttributeFactor = 0
		-- define additional attributes factor
		if unitDesc.attributes["Modern Tanks"] and unitDesc.attributes["Modern Tanks"] == true then
			AttributeFactor = 5 -- tanks already have a great life value due to heavy armor (T-72 is 25, BMP3 is 4)
		elseif unitDesc.attributes.ATGM and unitDesc.attributes.ATGM == true then
			AttributeFactor = 15 -- ATGM value can improve drastically killing ability, for tanks also, so it will add a lot.
		elseif unitDesc.attributes.IFV and unitDesc.attributes.IFV == true then
			AttributeFactor = 7								
		elseif unitDesc.attributes.APC and unitDesc.attributes.APC == true then
			AttributeFactor = 2
		elseif unitDesc.attributes["Armed vehicles"] and unitDesc.maxSlopeAngle > 0.25 and unitDesc.speedMaxOffRoad > 30 and unitDesc.riverCrossing == true and unitDesc.massEmpty < 6500 and ClassValue < 9 then	
			AttributeFactor = 0.5 -- those are the same parameters for recon groups.
		end				
		--]]--
		
		Strenght = Strenght + AttributeFactor
		
		return Strenght
	end
	--]]--
	
	local evaluateClass = function(evaluateValue) -- evaluateValue can be a group name or a unit type!
		
		local unitTable = nil
		for coa_name, coa_data in pairs(env.mission.coalition) do
			if coa_data.country then
				for cntry_id, cntry_data in pairs(coa_data.country) do
					for obj_type_name, obj_type_data in pairs(cntry_data) do
						if obj_type_name == "vehicle" then --should be an unncessary check
							if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
								for group_num, group_data in pairs(obj_type_data.group) do
									if group_data and group_data.units and type(group_data.units) == 'table' then
										local group_Name = env.getValueDictByKey(group_data.name)			
										if evaluateValue == group_Name then
											unitTable = group_data.units
										end
									end
								end
							end
						end
					end
				end
			end
		end
		
		local Class = "unknown"
		local ClassValue = 0
		
		if unitTable == nil then
			local unitDesc = Unit.getDescByName(evaluateValue)
			if unitDesc ~= nil then
				if unitDesc.attributes["Modern Tanks"] == true and ClassValue < 20 then
					Class = "MBT" 
					ClassValue = 20
				elseif unitDesc.attributes.ATGM and ClassValue < 19 then
					Class = "ATGM" 
					ClassValue = 19
				elseif unitDesc.attributes.IFV and ClassValue < 18 then
					Class = "IFV" 
					ClassValue = 18
				elseif unitDesc.attributes.MLRS and ClassValue < 17 then
					Class = "MLRS" 
					ClassValue = 17		
				elseif unitDesc.attributes.Artillery and ClassValue < 16 then
					Class = "ARTY" 
					ClassValue = 16
				elseif unitDesc.attributes.MANPADS and ClassValue < 15 then
					Class = "MANPADS" 
					ClassValue = 15
				elseif unitDesc.attributes["IR Guided SAM"] and ClassValue < 14 then
					Class = "IRSAM" 
					ClassValue = 14
				elseif unitDesc.attributes["SR SAM"] and ClassValue < 13 then
					Class = "SRSAM" 
					ClassValue = 13
				elseif unitDesc.attributes["MR SAM"] and ClassValue < 12 then
					Class = "MRSAM" 
					ClassValue = 12
				elseif unitDesc.attributes["LR SAM"] and ClassValue < 11 then
					Class = "LRSAM" 
					ClassValue = 11
				elseif unitDesc.attributes["Mobile AAA"] and ClassValue < 10 then
					Class = "AAA" 
					ClassValue = 10
				elseif unitDesc.attributes["Armed vehicles"] and unitDesc.maxSlopeAngle > 0.25 and unitDesc.speedMaxOffRoad > 30 and unitDesc.riverCrossing == true and unitDesc.massEmpty < 6500 and ClassValue < 9 then
					Class = "REC" 
					ClassValue = 9
				elseif unitDesc.attributes.APC and unitDesc.attributes.APC == true and ClassValue < 8 then
					Class = "APC" 
					ClassValue = 8	
				end					
			end
		else
			for id, unitData in pairs(unitTable) do
				local unitDesc = Unit.getDescByName(unitData.type)
				if unitDesc.attributes["Modern Tanks"] == true and ClassValue < 20 then
					Class = "MBT" 
					ClassValue = 20
				elseif unitDesc.attributes.ATGM and ClassValue < 19 then
					Class = "ATGM" 
					ClassValue = 19
				elseif unitDesc.attributes.IFV and ClassValue < 18 then
					Class = "IFV" 
					ClassValue = 18
				elseif unitDesc.attributes.MLRS and ClassValue < 17 then
					Class = "MLRS" 
					ClassValue = 17		
				elseif unitDesc.attributes.Artillery and ClassValue < 16 then
					Class = "ARTY" 
					ClassValue = 16
				elseif unitDesc.attributes.MANPADS and ClassValue < 15 then
					Class = "MANPADS" 
					ClassValue = 15
				elseif unitDesc.attributes["IR Guided SAM"] and ClassValue < 14 then
					Class = "IRSAM" 
					ClassValue = 14
				elseif unitDesc.attributes["SR SAM"] and ClassValue < 13 then
					Class = "SRSAM" 
					ClassValue = 13
				elseif unitDesc.attributes["MR SAM"] and ClassValue < 12 then
					Class = "MRSAM" 
					ClassValue = 12
				elseif unitDesc.attributes["LR SAM"] and ClassValue < 11 then
					Class = "LRSAM" 
					ClassValue = 11
				elseif unitDesc.attributes["Mobile AAA"] and ClassValue < 10 then
					Class = "AAA" 
					ClassValue = 10
				elseif unitDesc.attributes["Armed vehicles"] and unitDesc.maxSlopeAngle > 0.25 and unitDesc.speedMaxOffRoad > 30 and unitDesc.riverCrossing == true and unitDesc.massEmpty < 6500 and ClassValue < 9 then
					Class = "REC" 
					ClassValue = 9
				elseif unitDesc.attributes.APC and unitDesc.attributes.APC == true and ClassValue < 8 then
					Class = "APC" 
					ClassValue = 8	
				end							
			end
		end
		return Class
	end
	--]]--				
	
	local addPlanning = function(GroupTable, Id, Coalition, MissionType, FromTERRname, ToTERRname, range, MissionPriority)
		if PLANtable then		
			if GroupTable and Id and Coalition and MissionType and FromTERRname and ToTERRname and MissionPriority then
				-- check existing plan and overwrite acknowledge
				local allowPlanning = true
				local groupName = GroupTable:getName()
				for pId, pData in pairs(PLANtable) do
					if pData.id == Id then
						if MissionPriority > pData.missionPriority then
							table.remove(PLANtable,pId)
							if debugProcess == true or debugProcessPLAN == true then
								env.info(("DAWS AIE  -  addPlanning, current plan overwrite existing one for group " .. groupName .. ": higher mission priority is issued"))
							end	
						elseif pData.plantime < endtime then
							table.remove(PLANtable,pId)
							if debugProcess == true or debugProcessPLAN == true then
								env.info(("DAWS AIE  -  addPlanning, current plan overwrite existing one for group " .. groupName .. ": end mission time has reached"))
							end	
						else
							allowPlanning = false
							if debugProcess == true or debugProcessPLAN == true then
								env.info(("DAWS AIE  -  addPlanning, Plan denied for group " .. groupName .. ", a current mission with higher priority is ongoing"))
							end									
						end
					end
				end

				if allowPlanning == true then
					if debugProcess == true or debugProcessPLAN == true then
						env.info(("DAWS AIE  -  addPlanning is planning mission ".. MissionType .. " for group ID: " .. Id .. ", priority: " .. tostring(MissionPriority)))
					end
					local timeShiftValue = ExeMissionTimeShift -- SHIFT 10 minuti!
					-- timing
					local issuedTimeValue = timer.getAbsTime() - globalCampaignStartTime
					local issuedTimeConversion = mist.time.getDHMS(math.floor(issuedTimeValue))
					local issuedTimeString = string.format("%02d", issuedTimeConversion.d+1) .. string.format("%02d", issuedTimeConversion.h) .. string.format("%02d", issuedTimeConversion.m) .. GlobalSceneryTimeLetter
					local startTimeValue = issuedTimeValue + timeShiftValue 
					local startTimeConversion = mist.time.getDHMS(math.floor(startTimeValue))
					local startTimeString = string.format("%02d", startTimeConversion.d+1) .. string.format("%02d", startTimeConversion.h) .. string.format("%02d", startTimeConversion.m) .. GlobalSceneryTimeLetter
					local endTimeValue = startTimeValue + groundMissionObsolescense*60
					local endTimeConversion = mist.time.getDHMS(math.floor(endTimeValue))
					local endTimeString = string.format("%02d", endTimeConversion.d+1) .. string.format("%02d", endTimeConversion.h) .. string.format("%02d", endTimeConversion.m) .. GlobalSceneryTimeLetter
					
					-- calculate starting location
					local currentPlace_name = FromTERRname
					local currentPlace_point = "//ERROR//"
					local currentPlace_point_String = "//ERROR//"
					for tId, tData in pairs(TERRtable) do
						if type(tId) == "number" then
							if tData.name == currentPlace_name then
								currentPlace_point = tData.point
							end
						end
					end
					currentPlace_point_Latitude, currentPlace_point_Longitude, currentPlace_point_Altitude = coord.LOtoLL(currentPlace_point)
					currentPlace_String = tostring(currentPlace_name) .. "; " .. tostring(currentPlace_point_Latitude) .. ", " .. tostring(currentPlace_point_Longitude)
					
					-- calculate ending location
					local destinationPlace_name = ToTERRname
					local destinationPlace_point = "//ERROR//"
					local destinationPlace_point_String = "//ERROR//"
					for tId, tData in pairs(TERRtable) do
						if type(tId) == "number" then
							if tData.name == destinationPlace_name then
								destinationPlace_point = tData.point
							end
						end
					end
					destinationPlace_point_Latitude, destinationPlace_point_Longitude, destinationPlace_point_Altitude = coord.LOtoLL(destinationPlace_point)
					destinationPlace_String = tostring(destinationPlace_name) .. "; " .. tostring(destinationPlace_point_Latitude) .. ", " .. tostring(destinationPlace_point_Longitude)
					
					--resume
					if debugProcess == true or debugProcessPLAN == true then
						env.info(("DAWS AIE  -  addPlanning is planning mission ".. MissionType .. " for group ID: " .. Id .. ", data available"))
					end
					if range == nil then
						range = 10000
					end				
					PLANtable[#PLANtable + 1] = {id = Id, coalition = Coalition, missiontype = MissionType, plantime = startTimeValue, plantimestring = startTimeString, endtime = endTimeValue,endtimestring = endTimeString, fromTERR = currentPlace_name, fromTERRpoint = currentPlace_point, fromTERRpointString = currentPlace_String, toTERRname = destinationPlace_name, toTERRpoint = destinationPlace_point, toTERRpointString = destinationPlace_String, group = tostring(groupName), groupTable = GroupTable, Range = range, missionPriority = MissionPriority}
					if debugProcess == true or debugProcessPLAN == true then
						env.info(("DAWS AIE  -  addPlanning is planning mission ".. MissionType .. " for group ID: " .. Id .. ", plan inserted in PLANtable"))
					end

					--ExeMission(GroupTable, Id, MissionType, destinationPlace_point, timeShiftValue, range) -- , timeShiftValue
					if debugProcess == true or debugProcessPLAN == true then
						env.info(("DAWS AIE  -  addPlanning is planning mission ".. MissionType .. " for group ID: " .. Id .. ", execute command scheduled at time " .. startTimeString))
					end
					
					--ExeMissionTimeShift = ExeMissionTimeShift + math.random(1,3)*60
					
					-- AGGIUNGI CODICE PER MENU RADIO?						
				end
			else
				if debugProcess == true or debugProcessPLAN == true then
					env.info(("DAWS AIE  -  addPlanning missing necessary variables, Plan NOT ADDED"))
					env.info(("DAWS AIE  -  addPlanning variables: GroupTable= ".. tostring(GroupTable) .. ", Id= " .. tostring(Id) .. ", Coalition= " .. tostring(Coalition) .. ", MissionType= " .. tostring(MissionType) .. ", FromTERRname= " .. tostring(FromTERRname) .. ", ToTERRname= " .. tostring(ToTERRname)))
				end							
			end
		end
	end
	
	
	local ExeMission = function(GroupTable, GroupId, mixType, DestPos, timeShift, range)
		if debugProcess == true or debugProcessPLAN == true then
			env.info(("DAWS AIE  -  ExeMission has been launched: GroupTable = " .. tostring(GroupTable) .. ", GroupId = " .. tostring(GroupId) .. ", mixType = " .. tostring(mixType) .. ", DestPos = " .. tostring(DestPos) .. ", timeShift = " .. tostring(timeShift) .. ", range = " .. tostring(range)   ))
		end	
		if GroupTable and GroupId and mixType and DestPos and timeShift then
		
			local groupAlive = false
			if GroupTable:getSize() > 0 then
				groupAlive = true
			end
			
			if groupAlive == true then
				if range == nil then
					range = 10000
				end	
				if debugProcess == true or debugProcessPLAN == true then
					env.info(("DAWS AIE  -  ExeMission is planning mission ".. mixType .. " for group ID: " .. GroupId .. ", groupAlive: " .. tostring(groupAlive)))					
				end				
				if mixType == "A" then			
					timer.scheduleFunction(mist.groupToRandomPoint,{group = GroupTable, point = DestPos, radius = math.random(minRandomRange,maxRandomRange), speed = StandardSpeedVel/3.603, disableRoads = StandardRoadDisable}, timer.getTime()+timeShift)
					timer.scheduleFunction(StopMovLOSwEnemy,{GroupId = GroupTable.id_, Range = range, Pos = DestPos, Table = GroupTable}, timer.getTime()+timeShift+30)
				elseif mixType == "B" then
					timer.scheduleFunction(mist.groupToRandomPoint,{group = GroupTable, point = DestPos, radius = math.random(minRandomRange,maxRandomRange), speed = StandardSpeedVel/3.603, disableRoads = StandardRoadDisable}, timer.getTime()+timeShift)
					timer.scheduleFunction(StopMovFixDistance,{GroupId = GroupTable.id_, Range = 50000, Pos = DestPos, Table = GroupTable}, timer.getTime()+timeShift+30)
				elseif mixType == "E" then
					timer.scheduleFunction(mist.groupToRandomPoint,{group = GroupTable, point = DestPos, radius = math.random(minRandomRange,maxRandomRange), speed = StandardSpeedVel/3.603, disableRoads = StandardRoadDisable}, timer.getTime()+timeShift)
					timer.scheduleFunction(StopMovFixDistance,{GroupId = GroupTable.id_, Range = 5000, Pos = DestPos, Table = GroupTable}, timer.getTime()+timeShift+30)					
				elseif mixType == "J" then
					timer.scheduleFunction(mist.groupToRandomPoint,{group = GroupTable, point = DestPos, radius = math.random(minRandomRange,maxRandomRange), speed = StandardSpeedVel/3.603, disableRoads = StandardRoadDisable}, timer.getTime()+timeShift)
					timer.scheduleFunction(StopMovLOSwEnemy,{GroupId = GroupTable.id_, Range = range, Pos = DestPos, Table = GroupTable}, timer.getTime()+timeShift+30)						
				end
				if debugProcess == true or debugProcessPLAN == true then
					env.info(("DAWS AIE  -  ExeMission has terminated planning"))
				end	
			end
		end
	end
	--]]--
	

	--#####################################################		
	--### 0 - initialization ##############################
	--#####################################################		


	local TERRtableMaxBldgLife = 0
	local territorytableBuilder = function(towntable)
		local Tid = 1
		--create territory table
		for tname, tdata in pairs(towntable) do
			local terr_name = tname
			local terr_point0 = coord.LLtoLO(tdata.latitude, tdata.longitude , 0)
			local terr_point_y = land.getHeight({x = terr_point0.x, y = terr_point0.z})
			local terr_point = coord.LLtoLO(tdata.latitude, tdata.longitude , terr_point_y)
			local terr_owner = "neutral" --> will be updated over time
			local terr_control = "void" --> will be updated over time
			local terr_blueforce = 0
			local terr_redforce = 0
			TERRtable[#TERRtable + 1] = {id = tonumber(Tid), name = terr_name, point = terr_point, owner = terr_owner, buildingslife = 0, controlled = terr_control, blueforce = tonumber(terr_blueforce), redforce = tonumber(terr_redforce), borderdistance = tonumber(5000), isBorder = false, priority = 0}
			Tid = Tid + 1
		end
		
		for tId, tData in pairs(TERRtable) do
			if type(tId) == "number" then
				local tPos = tData.point
				local tDist = 500000 --m
				for atId, atData in pairs(TERRtable) do
					if atId ~= tId then
						local atPos = atData.point
						local distance = mist.utils.get3DDist(tPos, atPos)
						if distance < tDist then
							tDist = math.floor(distance)									
						end

						--local tangle_m = (atData.point.z - tData.point.z) / (atData.point.x-tData.point.x)
						local tangle_r = math.atan2((atData.point.z - tData.point.z),(atData.point.x-tData.point.x))
						local tangle_p = math.floor((tangle_r*180/math.pi))
						local tangle = tangle_p
						if type(tangle) == "number" then
							if tangle < 0 then tangle = tangle + 360 end
						end
						--[[
						if debugProcess == true and distance < 10000 then
							env.info(("DAWS AIE  -  territorytableBuilder: terrain1: ".. tData.name .. ", terrain2: ".. atData.name .. ", tangle: " .. tostring(tangle)))
						end
						--]]--
					end
				end
				--]]--
				local tBorder = math.floor((tDist * 1.1 / 2))
				tData.borderdistance = tBorder
			end
		end

		for tId, tData in pairs(TERRtable) do
			if type(tId) == "number" then
				
				--buildings
				local curr_buildings = 0
				local curr_totallife = 0
				local volS = {
				  id = world.VolumeType.SPHERE,
				  params = {
					point = tData.point,
					radius = tData.borderdistance
				  }
				}
				local ifFound = function(foundItem, val)
					curr_buildings = curr_buildings + 1
					local a_life = foundItem:getLife()	
					curr_totallife = curr_totallife + a_life
				end
				world.searchObjects(Object.Category.SCENERY, volS, ifFound)
				tData.buildingslife = curr_totallife
				if TERRtableMaxBldgLife < curr_totallife and curr_totallife < 10000000 then
					TERRtableMaxBldgLife = curr_totallife
				end
				--]]--					
			end
		end

		for tId, tData in pairs(TERRtable) do
			if type(tId) == "number" then
				if tData.buildingslife > TERRtableMaxBldgLife then -- this will filter natural or indestructible structures (dam)
					tData.priority = 0
				else
					tData.priority = math.floor((tData.buildingslife/TERRtableMaxBldgLife)*10+1)
				end
				tData.buildingslife = nil
			end
		end
		
		if debugProcess == true then
			env.info(("DAWS AIE  -  territorytableBuilder: initial territory table created"))
		end		
		if SuperdebugProcess == true then
			--dumpTable("DAWS AIE  -  TERRtable_init.lua", TERRtable)
			--dumpTable("DAWS AIE  -  SCEN_OBJtable.lua", SCEN_OBJtable)
		end
		
	end
	
	-- load current used territories
	if LoadTerritory == "Caucasus" then
		territorytableBuilder(CaucasusBase_towns)
	elseif LoadTerritory == "Nevada" then
		territorytableBuilder(Nevada_towns)
	elseif LoadTerritory == "Hormuz" then
		territorytableBuilder(SoH_towns)
	end
	
	if DWterritoryFilter == true then
		for tId, tData in pairs(TERRtable) do
			local TERRpos = tData.point
			local TerrProxyFilter = false
			for coa_name, coa_data in pairs(env.mission.coalition) do
				if coa_data.country then
					for cntry_id, cntry_data in pairs(coa_data.country) do
						for obj_type_name, obj_type_data in pairs(cntry_data) do
							if obj_type_name == "vehicle" then --should be an unncessary check
								if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
									for group_num, group_data in pairs(obj_type_data.group) do
										if group_data and group_data.units and type(group_data.units) == 'table' then
											for id, unitData in pairs(group_data.units) do
												if id == 1 then
													local EvunitId = unitData.unitId
													for _, mistData in pairs(mist.DBs.MEunitsById) do 
														if mistData.unitId == EvunitId then
															local UNITpos = {x = mistData.point.x, y = land.getHeight({x = mistData.point.x, y = mistData.point.y}) ,z = mistData.point.y}
															if mist.utils.get3DDist(TERRpos,UNITpos) < DWterritoryFilterThreshold then
																TerrProxyFilter = true
															end
														end
													end
												end			
											end	
										end
									end
								end
							end
						end
					end
				end
			end
			
			if TerrProxyFilter == false then
				table.remove(TERRtable,tId)
			end
			
		end
	end
	
	local territoryZoneCreator = function()  --> TO BE USED ONCE INTEGRATED IN DAWS SAVE MISSION
		local zoneTable = {}
		local tzoneId = 3000
		for tId, tData in pairs(TERRtable) do
			if type(tId) == "number" then
				tzoneId = tzoneId + 1
				local zone_y = tData.point.z
				local zone_x = tData.point.x
				local zone_radius = tData.borderdistance
				local zone_zoneId = tzoneId
				local zone_hidden = false
				local zone_name = tData.name
				local zone_color = {}
				if tData.owner == "blue" then
					zone_color[#zone_color + 1] = 0
					zone_color[#zone_color + 1] = 0
					zone_color[#zone_color + 1] = 1
					zone_color[#zone_color + 1] = 0.15
				elseif tData.owner == "red" then
					zone_color[#zone_color + 1] = 1
					zone_color[#zone_color + 1] = 0
					zone_color[#zone_color + 1] = 0
					zone_color[#zone_color + 1] = 0.15
				else
					zone_color[#zone_color + 1] = 0.5
					zone_color[#zone_color + 1] = 0.5
					zone_color[#zone_color + 1] = 0.5
					zone_color[#zone_color + 1] = 0.15
				end				
				zoneTable[#zoneTable + 1] = {x = zone_x, y = zone_y, radius = zone_radius, zoneId = zone_zoneId, hidden = zone_hidden, name = zone_name, color = zone_color}	
			end
		end

		local tableName = logsdirectory .. "DAWS AIE  -  TERRtableZones_now.lua"
		local outFile = io.open(tableName, "w");
		local newZoneStr = IntegratedserializeWithCycles('zones', zoneTable);
		outFile:write(newZoneStr);
		io.close(outFile);				
	end		

	--#####################################################
	--### A - group update status (ORBAT) ################# 
--	#####################################################		
	
	local UpdateORBAT_states = table.getn(ORBATtable)
	local UpdateORBAT_statenum = 1	
	local BuildORBAT = true

	local UpdateORBAT = function() -- REBUILT WITH ALIVE UNITS?
		local numfound = false
		if BuildORBAT == true then
			for coa_name, coa_data in pairs(env.mission.coalition) do
				if coa_data.country then
					for cntry_id, cntry_data in pairs(coa_data.country) do
						for obj_type_name, obj_type_data in pairs(cntry_data) do
							if obj_type_name == "vehicle" then --should be an unncessary check
								if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
									for group_num, group_data in pairs(obj_type_data.group) do
										if group_data and group_data.units and type(group_data.units) == 'table' then
											local addingGroup_Name = env.getValueDictByKey(group_data.name)
											if debugProcess == true then
												env.info(("DAWS AIE  -  UpdateORBAT -BuildORBAT- is evaluating group: " .. tostring(addingGroup_Name)))
											end
											local addingGroup_Id = group_data.groupId
											local addingGroup_Coalition = coa_name
											--local addingGroup_Ctry = groupData.country										
											local addingGroup_Units	= group_data.units
											local addingGroup_Pos = nil -- Group.getByName(addingGroup_Name):getUnit(1):getPosition().p
											local addingGroup_Strenght = 0
											local addingGroup_Terr = "none"
											for id, unitData in pairs(addingGroup_Units) do
												if id == 1 then
													local EvunitName = env.getValueDictByKey(unitData.name)
													local EvunitId = unitData.unitId
													if debugProcess == true then
														env.info(("DAWS AIE  -  UpdateORBAT -BuildORBAT- is evaluating first unit position, unit: ".. EvunitName))
													end
													for _, mistData in pairs(mist.DBs.MEunitsById) do 
														if mistData.unitId == EvunitId then
														if debugProcess == true then
															env.info(("DAWS AIE  -  UpdateORBAT -BuildORBAT- found an aliveUnit name: ".. mistData.unitName))
														end
														local Pos = {x = mistData.point.x, y = land.getHeight({x = mistData.point.x, y = mistData.point.y}) ,z = mistData.point.y}
														local firstUnitPos = Pos --Unit.getByName(unitName):getPosition().p
															if firstUnitPos ~= nil then
																addingGroup_Pos = firstUnitPos
															else
																if debugProcess == true then
																	env.info(("DAWS AIE  -  UpdateORBAT -BuildORBAT- Pos is nil!"))
																end																
															end															
														end
													end

													
												end

												local unitDesc = Unit.getDescByName(unitData.type)
												local unitSizeFactor = evaluateStrenght(unitDesc)
												addingGroup_Strenght = addingGroup_Strenght + unitSizeFactor				
											end
											--define territory
											local minDistance = 100000000000 --m
											for tid, tData in pairs(TERRtable) do
												if type(tid) == "number" then
													local tPos = tData.point				
													local distance = mist.utils.get3DDist(tPos, addingGroup_Pos)
													if distance < minDistance then
														minDistance = distance
														addingGroup_Terr = tData.name
													end		
												end
											end												
											
											-- define class
											local addingGroup_Class = evaluateClass(addingGroup_Name)			
											
											if addingGroup_Strenght > 0 then
												if debugProcess == true and unitDesc ~= nil then
													env.info(("DAWS AIE  -  UpdateORBAT -BuildORBAT- added group Id= " .. tostring(addingGroup_Id) .. ", Strenght:  " .. tostring(addingGroup_Strenght)))
												end		
												ORBATtable[#ORBATtable + 1] = {Id = addingGroup_Id, Name = addingGroup_Name, Coalition = addingGroup_Coalition, Pos = addingGroup_Pos, Territory = addingGroup_Terr, Strenght = addingGroup_Strenght, Class = addingGroup_Class, Units = addingGroup_Units}
											else
												if debugProcess == true and unitDesc ~= nil then
													env.info(("DAWS AIE  -  UpdateORBAT -BuildORBAT- can't add group Id= " .. tostring(addingGroup_Id) .. ", Strenght:  " .. tostring(addingGroup_Strenght)))
												end						
											end												
										end
									end
								end
							end
						end
					end
				end
			end			
			--ORBATtable["totalBlueForce"] = 0
			--ORBATtable["totalRedForce"] = 0
			--ORBATtable["sim_time"] = 0
			--ORBATtable["orbat_time"] = 0
			
			BuildORBAT = false
		end
		--]]--
		
		for id, ORBATdata in pairs(ORBATtable) do
			if id == UpdateORBAT_statenum then
				local updatingGroup_Name = ORBATdata.Name
				local updatingGroup_Id = ORBATdata.Id
				--local updatingGroup_Table = Group.getByName(updatingGroup_Name)
				--local updatingGroup_Units = nil --updatingGroup_Table:getUnits()
				local updatingGroup_Pos = nil
				local updatingGroup_Strenght = 0
				local updatingGroup_Terr = ORBATdata.Territory

				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateORBAT is updating group " .. updatingGroup_Name .. ", groupId: " .. updatingGroup_Id))
				end
				
				local groupAlive = false
				for _, unitData in pairs(mist.DBs.aliveUnits) do
					--if debugProcess == true then
						--env.info(("DAWS AIE  -  UpdateORBAT matching alive unit " .. unitData.unitName .. ", groupId: " .. unitData.groupId))
					--end
					if unitData.groupId == updatingGroup_Id then
						groupAlive = true
						--[[
						if debugProcess == true then
							env.info(("DAWS AIE  -  UpdateORBAT found a match with aliveunit " .. unitData.unitName))
						end	
						--]]--
						local firstUnitPos = unitData.pos --Unit.getByName(unitData.name):getPosition().p
						local isupdating = "cant check firsUnitPos"
						if firstUnitPos ~= nil then
							updatingGroup_Pos = firstUnitPos
							isupdating = "has been updated, updatingGroup_Pos is not nil"
						else
							isupdating = "can't update due to firsUnitPos is nil"
						end
						local minDistance = 100000000000 --m
						for tid, tData in pairs(TERRtable) do
							if type(tid) == "number" then
								local tPos = tData.point				
								local distance = mist.utils.get3DDist(tPos, updatingGroup_Pos)
								if distance < minDistance then
									minDistance = distance
									updatingGroup_Terr = tData.name
								end		
							end
						end							
						--[[
						if debugProcess == true then
							env.info(("DAWS AIE  -  UpdateORBAT Pos update: " .. isupdating))
						end	
						--]]--
						local unitDesc = Unit.getDescByName(unitData.type)
						local unitSizeFactor = evaluateStrenght(unitDesc)
						updatingGroup_Strenght = updatingGroup_Strenght + unitSizeFactor								
					end
				end
				
				if debugProcess == true and unitDesc then
					env.info(("DAWS AIE  -  UpdateORBAT total group strenght " .. updatingGroup_Strenght))
				end	
				
				if updatingGroup_Pos and updatingGroup_Strenght > 0 then
					ORBATdata.Pos = updatingGroup_Pos
					ORBATdata.Strenght = updatingGroup_Strenght
					ORBATdata.Territory = updatingGroup_Terr
				end
				
				if groupAlive == false then
					table.remove(ORBATtable,id)
				end
				numfound = true
			end				
		end
		--]]--
			
		if numfound == false then
			UpdateORBAT_statenum = 1
			if debugProcess == true then
				env.info(("DAWS AIE  -  UpdateORBAT has ended its cycle"))
			end				
			local totalBlueForce = 0
			for _, gData in pairs(ORBATtable) do
				if gData.Coalition == "blue" and gData.Class ~= "unknown" then
					totalBlueForce = totalBlueForce + gData.Strenght
				end
			end
			local totalRedForce = 0
			for _, gData in pairs(ORBATtable) do
				if gData.Coalition == "red" and gData.Class ~= "unknown" then
					totalRedForce = totalRedForce + gData.Strenght
				end
			end				
			--ORBATtable.totalBlueForce = totalBlueForce
			--ORBATtable.totalRedForce = totalRedForce
			--ORBAT_miz_time_table = mist.time.getDHMS(math.floor(timer.getAbsTime()))
			--ORBATtable.sim_time = math.floor(timer.getAbsTime())
			--ORBATtable["sitrep_time"] = ORBAT_miz_time_table.d .. "." .. ORBAT_miz_time_table.h .. "." .. ORBAT_miz_time_table.m .. "." .. ORBAT_miz_time_table.s				
			--ORBATtable.orbat_time = string.format("%02d", ORBAT_miz_time_table.d+1) .. string.format("%02d", ORBAT_miz_time_table.h) .. string.format("%02d", ORBAT_miz_time_table.m) .. "D"
			timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
			if SuperdebugProcess == true then
				dumpTable("DAWS AIE  -  ORBATtable_now.lua", ORBATtable)
			end	
		else
			UpdateORBAT_statenum = UpdateORBAT_statenum + 1
			--[[
			if debugProcess == true then
				env.info(("DAWS AIE  -  UpdateORBAT updated UpdateORBAT_statenum to = " .. UpdateORBAT_statenum))
			end	
			--]]--
			timer.scheduleFunction(UpdateORBAT, {}, timer.getTime()+ updateShift)
		end					
		--]]--			
		
	end
	--]]--

	--#####################################################
	--### B - intel update status #########################
	--#####################################################

	local UpdateIntel_statenum = 1		
	local BuildIntel = true
	local UpdateIntel = function()
		--
		if debugProcess == true then
			env.info(("DAWS AIE  -  UpdateIntel has been launched"))
		end
		--]]--
		if BuildIntel == true then
			for _, unitData in pairs(mist.DBs.aliveUnits) do
				indexUnits[#indexUnits + 1] = {id = unitData.unit.id_}
			end			
			BuildIntel = false
		end
		--]]--

		local numfound = false
		local choosenId = nil
		for index, indexid in pairs(indexUnits) do
			if index == UpdateIntel_statenum then
				choosenId = indexid.id
			end
		end
		--]]--
		
		local doneGroupTempTable = {}
		
		-- updating INTELtable table
		for _, unitData in pairs(mist.DBs.aliveUnits) do
			if unitData.unit.id_ == choosenId then
				
				numfound = true
				
				-- skip already controlled groups
				local proceed = true
				for dgtId, dgtData in pairs(doneGroupTempTable) do
					if dgtData.groupIdDone == unitData.groupId then
						proceed = false
					end
				end
									
				if proceed == true then
					-- retrieve target table
					local unitTargets = Unit.getByName(unitData.unitName):getGroup():getController():getDetectedTargets()
					doneGroupTempTable[#doneGroupTempTable + 1] = {groupIdDone = unitData.groupId}
					
					if debugProcess == true then
						if unitTargets then
							if table.getn(unitTargets) > 0 then
								env.info(("DAWS AIE  -  UpdateIntel found tgt table for " .. unitData.unitName .. " with " .. table.getn(unitTargets) .. " targets"))
							end
						end
					end
					--]]--
				
					-- retrieve target data
					for _, tgtData in pairs(unitTargets) do
						local id = tgtData.object.id_
						--[[
						if debugProcess == true then
							env.info(("DAWS AIE  -  UpdateIntel evaluating tgt id_:" .. tostring(id)))
						end				
						--]]--
						for _, unitData in pairs(mist.DBs.aliveUnits) do
							local uid = unitData.unit.id_
							if uid == id then
								if unitData.category == "vehicle" or unitData.category == "static" then
									--[[
									if debugProcess == true then
										env.info(("DAWS AIE  -  UpdateIntel found match in alive dB"))
									end
									--]]--
									local tunitId = uid
									local tunitType = unitData.type
									local tunitPos = unitData.pos
									local tunitCoa = unitData.coalition
									local tunitTime = timer.getAbsTime() - globalCampaignStartTime -- simulation time in seconds
									local tunitDesc = Unit.getDescByName(tunitType)
									local tunitStrenght = evaluateStrenght(tunitDesc)
									local tunitClass = evaluateClass(tunitType)

									if debugProcess == true then
										env.info(("DAWS AIE  -  UpdateIntel tgt data: Type = " .. tunitType .. ", Coa = " .. tunitCoa .. ", Territory = " .. tunitTerr .. ", Strenght = " .. tunitStrenght .. ", Time = " .. tunitTime .. ", Class = " .. tunitClass))
									end
									if table.getn(INTELtable) > 0 then
										for tid, knownData in pairs (INTELtable) do
											if knownData.unitId == tunitId then
												--[[
												if debugProcess == true then
													env.info(("DAWS AIE  -  UpdateIntel tgt data found in INTELtable, overwriting"))
												end
												--]]--
												table.remove(INTELtable, tid)
											end
										end
										INTELtable[#INTELtable + 1] = {unitId = tunitId, unitType = tunitType, unitPos = tunitPos, unitCoa = tunitCoa, unitStrenght = tunitStrenght, unitTime = tunitTime, unitClass = tunitClass}
										--[[
										if debugProcess == true then
											env.info(("DAWS AIE  -  UpdateIntel tgt data added to INTELtable"))
										end	
										--]]--
									else
										INTELtable[#INTELtable + 1] = {unitId = tunitId, unitType = tunitType, unitPos = tunitPos, unitCoa = tunitCoa, unitStrenght = tunitStrenght, unitTime = tunitTime, unitClass = tunitClass}
									end
								end
							end
						end
					end
				end
				
				
			end
		end
		--]]--
		
		if numfound == false then
			UpdateIntel_statenum = 1
			if debugProcess == true then
				env.info(("DAWS AIE  -  UpdateIntel has ended its cycle"))
			end
			if SuperdebugProcess == true then
				dumpTable("DAWS AIE  -  INTELtable.lua", INTELtable)
			end
			
			timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
			
		else
			UpdateIntel_statenum = UpdateIntel_statenum + 1
			--[[
			if debugProcess == true then
				env.info(("DAWS AIE  -  UpdateIntel updated UpdateIntel_statenum to = " .. UpdateIntel_statenum))
			end		
			--]]--
			timer.scheduleFunction(UpdateIntel, {}, timer.getTime()+ updateShift)
		end					
		--]]--
		
		--additional handler to remove from intel of killed units.			
		local INTELhandler = {}
		function INTELhandler:onEvent(event)
			if(world.event.S_EVENT_DEAD == event.id) then
				if event.initiator ~= nil then
					local euTable = event.initiator
					local euId = nil
					if euTable:getCategory() == 1 then
						if euTable then
							euId = euTable:getID()
						end
					end
					if debugProcess == true then
						env.info(("DAWS AIE  -  UpdateIntel eventhandler: unit has destroyed. ID: ".. tostring(unitId)))
					end
					for iId, iData in pairs(INTELtable) do
						if iData.unitId == euId then
							if debugProcess == true then
								env.info(("DAWS AIE  -  UpdateIntel eventhandler: unit was inside INTELtable. entry removed."))
							end								
							table.remove(INTELtable, iId)
						end
					end
				end
			end
		end			
		world.addEventHandler(INTELhandler)
		
	end
	--]]--
	
	--#####################################################
	--### C - territory update status #####################		
	--#####################################################			
	
	-- this function will assign/reassign ownership of a territory
	local UpdateOwnership_statenum = 1
	local UpdateOwnership_phase = "A"
	local UpdateOwnership = function()
		if debugProcess == true and UpdateOwnership_states == 0 then
			env.info(("DAWS AIE  -  UpdateOwnership: territory table is void"))
		end
		local numfound = false
		
		if UpdateOwnership_phase == "A" then	
			-- Phase A cycle -- check ownership
			for num, tdata in pairs(TERRtable) do
				if type(num) == "number" then
					if num == UpdateOwnership_statenum then
						--if debugProcess == true then
						--	env.info(("DAWS AIE  -  UpdateOwnership evaluating territory with id = " .. tostring(tdata.id) .. ", name: " .. tostring(tdata.name)))
						--end		
						numfound = true		
						--reset control (if a blue group has moved away, ownership persist, but controlled status switch to "neutral")
						tdata.controlled = "void"
						
						--check blue presence
						local blue_force_size = 0 
						local red_force_size = 0
						local evaluateDistance = 0
						for id, ORBATdata in pairs(ORBATtable) do
							if type(id) == 'number' then
								local ORBATgroup = ORBATdata.Name
								--if debugProcess == true then
									--env.info(("DAWS AIE  -  UpdateOwnership checking ORBAT group  = " .. tostring(ORBATgroup)))
								--end					
								local distance = mist.utils.get3DDist(ORBATdata.Pos, tdata.point)
								--if debugProcess == true then
								--	env.info(("DAWS AIE  -  UpdateOwnership ORBATgroup " .. tostring(ORBATgroup) .. " is has a distance of " .. distance .. " meters"))
								--end	
								if tdata.borderdistance <= 2000 then
									evaluateDistance = 2000
								else
									evaluateDistance = tdata.borderdistance
								end
								
								if distance and distance < evaluateDistance then
									--if debugProcess == true then
										--env.info(("DAWS AIE  -  UpdateOwnership ORBATgroup " .. tostring(ORBATgroup) .. " is inside evaluateDistance range"))
									--end
									if ORBATdata.Coalition == "blue" then
										local groupStrenght = ORBATdata.Strenght
										local groupName = ORBATdata.Name
										--if debugProcess == true then
										--	env.info(("DAWS AIE  -  UpdateOwnership added blue force = " .. tostring(groupStrenght) .. ", group name: " .. tostring(groupName) .. ", territory: " .. tostring(tdata.name)))
										--end
										blue_force_size = blue_force_size + groupStrenght
									elseif ORBATdata.Coalition == "red" then
										local groupStrenght = ORBATdata.Strenght
										local groupName = ORBATdata.Name
										--if debugProcess == true then
										--	env.info(("DAWS AIE  -  UpdateOwnership added red force = " .. tostring(groupStrenght) .. ", group name: " .. tostring(groupName) .. ", territory: " .. tostring(tdata.name)))
										--end										
										red_force_size = red_force_size + groupStrenght	
									else
										--if debugProcess == true then
										--	env.info(("DAWS AIE  -  UpdateOwnership can't find Coalition match between " .. ORBATdata.Coalition .. " and blue or red"))
										--end
									end
								end
								
							end
						end
						--]]--

						tdata.blueforce = blue_force_size
						tdata.redforce = red_force_size

						--update status
						local actualControlled = tdata.controlled
						local actualOwner = tdata.owner
						
						if tdata.redforce > 0 and tdata.blueforce > 0 then
							tdata.controlled = "contended"
						elseif tdata.blueforce > 0 and tdata.redforce == 0 then
							tdata.controlled = "blue"
						elseif tdata.redforce > 0 and tdata.blueforce == 0 then
							tdata.controlled = "red"					
						elseif tdata.redforce == 0 and tdata.blueforce == 0 then
							tdata.controlled = "void"						
						else
							tdata.controlled = "error"		
						end
						
						--update ownership
						if tdata.controlled == "contended" then
							tdata.owner = "neutral"
						elseif tdata.controlled ~= tdata.owner and tdata.controlled ~= "void" then
							tdata.owner = tdata.controlled
						end	
						--if debugProcess == true and actualOwner ~= tdata.owner then
						--	env.info(("DAWS AIE  -  UpdateOwnership territory ".. tostring(tdata.name) .. " is now owned by " .. tdata.owner .. ". previous: " .. actualOwner))
						--end					
					end	--> if tdata.id == UpdateOwnership_statenum then
				end
			end
			-- Phase A closing
			if numfound == false then
				UpdateOwnership_statenum = 1
				UpdateOwnership_phase = "B"
				timer.scheduleFunction(UpdateOwnership, {}, timer.getTime()+ updateShift)

			else
				UpdateOwnership_statenum = UpdateOwnership_statenum + 1
				--[[
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateOwnership, Phase A, updated UpdateOwnership_statenum to = " .. UpdateOwnership_statenum))
				end
				--]]--
				timer.scheduleFunction(UpdateOwnership, {}, timer.getTime()+ updateShift)
			end			
								
		elseif UpdateOwnership_phase == "B" then
			-- Phase B cycle -- check borders
			for num, tdata in pairs(TERRtable) do
				if type(num) == "number" then
					if num == UpdateOwnership_statenum then				
						numfound = true	
						tdata.isBorder = false
						for x_num, x_tdata in pairs(TERRtable) do
							local distance = mist.utils.get3DDist(tdata.point, x_tdata.point)
							if distance < 8000 and x_tdata.owner ~= "neutral" and tdata.owner ~= "neutral" then -- so it's of the other coa or contended
								tdata.isBorder = true
							end
						end
					end
				end
			end
			-- Phase B closing
			if numfound == false then
				UpdateOwnership_statenum = 1
				UpdateOwnership_phase = "A"
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateOwnership has ended its cycle"))
				end					
				if SuperdebugProcess == true then
					dumpTable("DAWS AIE  -  TERRtable_now.lua", TERRtable)

				end
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)

			else
				UpdateOwnership_statenum = UpdateOwnership_statenum + 1
				--[[
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateOwnership, Phase C, updated UpdateOwnership_statenum to = " .. UpdateOwnership_statenum))
				end
				--]]--
				timer.scheduleFunction(UpdateOwnership, {}, timer.getTime()+ updateShift)
			end					
		end
	end
	--]]--


	--#####################################################
	--### X - TEST GOAP PLAN SYS ##########################
	--#####################################################	


	









	--#####################################################
	--### D - coalition sitrep ############################
	--#####################################################		

	
	--[[ DEFINE SITREP:
		Phases (repeated for each coalition to reduce cpu load):
			TERRloop 	- Reharse territory information, create a sitrep entry for each controlled territory (SET)
			INTELloop 	- Collect enemy intel info for each territory within 50 km from current SET
			ORBATloop 	- Assess allied groups class & strenght for SET
			RESUMEloop 	- Analyze collected data and update planning indexes

		riskFactor:
		+1 if enemy is stronger than ally * enemyForceFactor (RESUMEloop)
		+1 if enemy has arty units in range (INTELloop)
		
		
		notes: find a way to reduce enemyintel distances.
		
	--]]--		
	
	--[[
	local SITREP_state = "TERRloop"    -- SITREPstate
	local SITREP_reset = false
	local SITREP_coa = "blue"
	local SITREP_statenum = 1
	local funcID_SITREP = nil
	local SITREP_index = 1
	local SITREP_progId = 1
	--]]--
	
	local BuildSITREP = true
	local SITREP_state = "BUILDloop"
	local SITREP_reset = false
	local SITREP_statenum = 1
	local funcID_SITREP = nil
	
	local UpdateSITREP = function()
		
		if SITREP_reset == true then
			SITREPtable = {}
			if debugProcess == true then
				env.info(("DAWS AIE  -  UpdateSITREP has resetted SITREPtable"))
			end				
		end
		--]]--
		
		local numFound = false
		
		if SITREP_state == "BUILDloop" then
			-- BUILDloop Cycle
			for tId, tData in pairs(TERRtable) do
				if tId == SITREP_statenum then
					numFound = true
					if tData.controlled == "contended" then -- create double entry: blue&red
						SITREPtable[#SITREPtable+1] = {coa = "blue", name = tData.name, point = tData.point, status = "unknown", alliedForces ={}, enemyForces ={}, enemyIntel ={}, priorityLevel = tData.priority, riskLevel = 0, allied_skirmish = 0, allied_range = 0, enemy_skirmish = 0, enemy_range = 0}
						SITREPtable[#SITREPtable+1] = {coa = "red", name = tData.name, point = tData.point, status = "unknown", alliedForces ={}, enemyForces ={}, enemyIntel ={}, priorityLevel = tData.priority, riskLevel = 0, allied_skirmish = 0, allied_range = 0, enemy_skirmish = 0, enemy_range = 0}
					elseif tData.controlled ~= "void" then -- create entry: blue or red
						SITREPtable[#SITREPtable+1] = {coa = tData.controlled, name = tData.name, point = tData.point, status = "unknown", alliedForces ={}, enemyForces ={}, enemyIntel ={}, priorityLevel = tData.priority, riskLevel = 0, allied_skirmish = 0, allied_range = 0, enemy_skirmish = 0, enemy_range = 0}
					end						
				end
			end			
			-- BUILDloop closing
			if numFound == false then
				SITREP_statenum = 1
				SITREP_state = "TERRloop"
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateSITREP has ended cycle, resetting SITREP_state to " .. SITREP_state))
				end
				SITREP_reset = false
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			else
				SITREP_statenum = SITREP_statenum + 1
				SITREP_reset = false
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			end				
		
		elseif SITREP_state == "TERRloop" then
			-- TERRloop Cycle
			for sId, sData in pairs(SITREPtable) do
				if type(sId) == "number" then
					if sId == SITREP_statenum then								
						numFound = true
						local tempTable = {}
						for tId, tData in pairs(TERRtable) do
							local tdistance = math.floor(mist.utils.get3DDist(tData.point, sData.point))
							if tdistance > 0 and tdistance < 50000 and tData.owner ~= sData.coa and tData.owner ~= "neutral" then
								local tangle_r = math.atan2((tData.point.z - sData.point.z),(tData.point.x-sData.point.x))								
								local tangle_p = math.floor((tangle_r*180/math.pi))
								local tangle = tangle_p
								local tdirection = "unknown"
								if type(tangle) == "number" then
									if tangle < 0 then tangle = tangle + 360 end
								end							
								if type(tdistance) == "number" and type(tangle) == "number" then
									if (tangle >= 315) or (tangle < 45) then
										tdirection = "north"
									elseif tangle >= 45 and tangle < 135 then
										tdirection = "east"
									elseif tangle >= 135 and tangle < 225 then
										tdirection = "south"
									elseif tangle >= 225 and tangle < 315 then
										tdirection = "west"								
									end
								end
								if debugProcess == true then
									env.info(("DAWS AIE  -  UpdateSITREP has added to sData.enemyIntel of " .. sData.name .. ", the terrain name: " .. tData.name))
								end									
								sData.enemyIntel[#sData.enemyIntel + 1] = {id = tData.id, name = tData.name, distance = tdistance, direction = tdirection, buildingslife = tData.buildingslife, mostimportant = false, nearest = false}
								-- tempTable
							end								
						end	
						
						-- cut extra territories > 5 entries							
						for currId, currData in pairs(sData.enemyIntel) do
							if currId > SITREPintelmaxentry then
								table.remove(sData.enemyIntel, currId)
							end
						end

						-- update nearest & mostimportant data
						local dist_min = 100000
						local life_max = 0
						local mostI = ""
						local nearE = ""
						for iId, iData in pairs (sData.enemyIntel) do
							if iData.distance < dist_min then
								nearE = iData.name
								dist_min = iData.distance
							end
							if iData.buildingslife > life_max then
								mostI = iData.name
								life_max = iData.buildingslife								
							end
						end
													
						for iId, iData in pairs (sData.enemyIntel) do
							if iData.name == nearE then
								iData.nearest = true
							end
							if iData.name == mostI then
								iData.mostimportant =true
							end
						end							
					end
				end	
			end	
			-- TERRloop closing
			if numFound == false then
				SITREP_statenum = 1
				SITREP_state = "INTELloop"
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateSITREP has ended cycle, resetting SITREP_state to " .. SITREP_state))
				end
				SITREP_reset = false
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			else
				SITREP_statenum = SITREP_statenum + 1
				SITREP_reset = false
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			end	
		
		elseif SITREP_state == "INTELloop" then	
			-- INTELloop Cycle
			for sId, sData in pairs(SITREPtable) do
				if type(sId) == "number" then
					if sId == SITREP_statenum then
					
						numFound = true
						if INTELtable and table.getn(INTELtable) > 0 then
						
							for iId, iData in pairs(INTELtable) do
								if iData.unitCoa ~= sData.coa then
															
									local enemyTerr = iData.unitTerr
									local enemyDist = math.floor(mist.utils.get3DDist(iData.unitPos, sData.point))
									local enemyClass = iData.unitClass
									if enemyDist <= enemySkirmishLimit then
										if enemyClass == "MBT" or enemyClass == "ATGM" or enemyClass == "IFV" or enemyClass == "APC" then
											if sData.enemyForces then
												local enemyId = iData.unitId
												local enemyType = iData.unitType
												local enemyStrenght = iData.unitStrenght
												sData.enemyForces[#sData.enemyForces + 1] = {unitId = enemyId, unitType = enemyType, unitStrenght = enemyStrenght, unitClass = enemyClass, unitTerr = enemyTerr}
												sData.enemy_skirmish = sData.enemy_skirmish + enemyStrenght
												if debugProcess == true then
													env.info(("DAWS AIE  -  UpdateSITREP has added a " .. enemyType .. " to enemyForces in  " .. enemyTerr))
												end	
											end
										end
									elseif enemyDist <= enemyArtyLimit then
										if enemyClass == "ARTY" or enemyClass == "MLRS" then
											if sData.enemyForces then
												local enemyId = iData.unitId
												local enemyType = iData.unitType
												local enemyStrenght = iData.unitStrenght
												sData.enemyForces[#sData.enemyForces + 1] = {unitId = enemyId, unitType = enemyType, unitStrenght = enemyStrenght, unitClass = enemyClass, unitTerr = enemyTerr}
												sData.enemy_range = sData.enemy_range + enemyStrenght
												if debugProcess == true then
													env.info(("DAWS AIE  -  UpdateSITREP has added a " .. enemyType .. " to enemyForces in  " .. enemyTerr))
												end	
											end
										end
									elseif enemyDist > enemySkirmishLimit and enemyDist <= enemyArtyLimit then
										if enemyClass == "MBT" or enemyClass == "ATGM" or enemyClass == "IFV" or enemyClass == "APC" then
											if sData.enemyForces then
												local enemyId = iData.unitId
												local enemyType = iData.unitType
												local enemyStrenght = iData.unitStrenght
												sData.enemyForces[#sData.enemyForces + 1] = {unitId = enemyId, unitType = enemyType, unitStrenght = enemyStrenght, unitClass = enemyClass, unitTerr = enemyTerr}
												--sData.enemy_range = sData.enemy_range + enemyStrenght
												riskLevel = riskLevel + 1 -- added 1 to the risk factor due to enemy skr units in proxymity
												if debugProcess == true then
													env.info(("DAWS AIE  -  UpdateSITREP has added a " .. enemyType .. " to enemyForces in  " .. enemyTerr))
												end													
											end	
										end
									end
								
								
								end	
							end
						end
					end
				end
			end	
			-- INTELloop closing
			if numFound == false then
				SITREP_statenum = 1
				SITREP_state = "ORBATloop"
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateSITREP has ended cycle, resetting SITREP_state to " .. SITREP_state))
				end
				SITREP_reset = false
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			else
				SITREP_statenum = SITREP_statenum + 1
				SITREP_reset = false							
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			end				

		elseif SITREP_state == "ORBATloop" then					
			-- ORBATloop Cycle
			for sId, sData in pairs(SITREPtable) do
				if type(sId) == "number" then
					if sId == SITREP_statenum then
						numFound = true
						--
						local sTerr = {}
						sTerr[#sTerr + 1] = {name = sData.name}
						for tId, tData in pairs(TERRtable) do
							if sData.name == tData.name then
								if tData.nearTERRtable then
									for head, hData in pairs(tData.nearTERRtable) do
										sTerr[#sTerr + 1] = {name = hData.name}
									end
								end
							end
						end
						--]]--
						
						--ORBATtable[#ORBATtable + 1] = {Id = addingGroup_Id, Name = addingGroup_Name, Coalition = addingGroup_Coalition, Pos = addingGroup_Pos, Territory = addingGroup_Terr, Strenght = addingGroup_Strenght, Class = addingGroup_Class, Units = addingGroup_Units}
						for oId, oData in pairs(ORBATtable) do
							if type(oId) == "number" then
								if oData.Coalition == sData.coa then
									local allyClass = oData.Class
									local allyTerr = oData.Territory
									if allyClass == "MBT" or allyClass == "ATGM" or allyClass == "IFV" or allyClass == "APC" and allyTerr == sData.name then
										if sData.alliedForces then
											local allyId = oData.Id
											--local enemyType = iData.unitType
											local allyStrenght = oData.Strenght
											sData.alliedForces[#sData.alliedForces + 1] = {groupId = allyId, groupStrenght = allyStrenght, groupClass = allyClass, groupTerr = allyTerr}
											sData.allied_skirmish = sData.allied_skirmish + allyStrenght
											if debugProcess == true then
												env.info(("DAWS AIE  -  UpdateSITREP has added an " .. allyClass .. " group to alliedForces in  " .. allyTerr))
											end	
										end
									elseif allyClass == "ARTY" or allyClass == "MLRS" then
										local allowTerr = false
										if allyTerr == sData.name then
											allowTerr = true
										else
											for tId, tData in pairs(TERRtable) do
												if sData.name == tData.name then
													if tData.nearTERRtable then
														for head, hData in pairs(tData.nearTERRtable) do
															if allyTerr == hData.name then
																allowTerr = true
															end
														end
													end
												end
											end
										end
										if allowTerr == true then
											if sData.alliedForces then
												local allyId = oData.Id
												--local enemyType = iData.unitType
												local allyStrenght = oData.Strenght
												sData.alliedForces[#sData.alliedForces + 1] = {Name = oData.Name, Class = oData.Class, Strenght = oData.Strenght, Territory = allyTerr, availableForPlanning = false}
												sData.allied_range = sData.allied_range + allyStrenght
												if debugProcess == true then
													env.info(("DAWS AIE  -  UpdateSITREP has added an " .. allyClass .. " group to alliedForces in  " .. allyTerr))
												end	
											end												
										end
									end
								end
							end
						end							
					end
				end
			end
			-- ORBATloop closing
			if numFound == false then
				SITREP_statenum = 1
				SITREP_state = "RESUMEloop"
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateSITREP has ended cycle, resetting SITREP_state to " .. SITREP_state))
				end
				SITREP_reset = false
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			else
				SITREP_statenum = SITREP_statenum + 1
				SITREP_reset = false							
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			end				
		
		elseif SITREP_state == "RESUMEloop" then
			-- RESUMEloop cycle
			for sId, sData in pairs(SITREPtable) do
				if sId == SITREP_statenum then
					numFound = true
					local riskLevel = 0				
							
					-- identify border status
					local borderDistance = 0
					for tId, tData in pairs (TERRtable) do
						if type(tId) == "number" then
							if tData.name == sData.name then
								borderDistance = tData.borderdistance*2
								if borderDistance < borderLimit then
									borderDistance = borderLimit
								end
							end
						end
					end					
					
					local currentBorderDist = borderDistance
					local currentNearBorderDist = borderDistance + (nearborderLimit-borderLimit)
					local minDistance = 10000000000
					if sData.enemyIntel and table.getn(sData.enemyIntel) > 0 then
						for _, proxytData in pairs(sData.enemyIntel) do
							if proxytData and proxytData.distance < minDistance then		
								minDistance = proxytData.distance
							end
						end
					end
					
					if minDistance > currentNearBorderDist then
						sData.status = "enemyFar"							
					elseif minDistance > currentBorderDist then
						sData.status = "enemyNear"
					elseif minDistance <= currentBorderDist then	
						if borderDistance > borderLimit then
							sData.status = "enemyBorder"
						else
							sData.status = "battle"
						end
					end
					--]]--
					
					-- set ARL factor
					local enemyARLfactor = 0.9

					-- evaluate skirmish
					if sData.allied_skirmish > sData.enemy_skirmish*enemyARLfactor*1.5 then
						riskLevel = riskLevel + 0
					elseif sData.allied_skirmish > sData.enemy_skirmish*enemyARLfactor*1.25 then
						riskLevel = riskLevel + 1
					elseif sData.allied_skirmish > sData.enemy_skirmish*enemyARLfactor*1 then
						riskLevel = riskLevel + 2
					elseif sData.allied_skirmish > sData.enemy_skirmish*enemyARLfactor*0.75 then
						riskLevel = riskLevel + 3
					end						

					-- evaluate range
					if sData.allied_range > sData.enemy_range*enemyARLfactor*1.5 then
						riskLevel = riskLevel + 0
					elseif sData.allied_range > sData.enemy_range*enemyARLfactor*1.25 then
						riskLevel = riskLevel + 1
					elseif sData.allied_range > sData.enemy_range*enemyARLfactor*1 then
						riskLevel = riskLevel + 2
					end											
					
					--final evaluation
					if sData.enemy_skirmish > 0 then -- enemies inside the same proxymity area
						sData.status = "battle"
					end						
					
					if debugProcess == true then
						env.info(("DAWS AIE  -  UpdateSITREP territory " .. sData.name .. ", current riskLevel: " .. riskLevel.. ", sData.status: " .. sData.status))
					end									
					
					sData.riskLevel = riskLevel
					
				end
			end	
			-- RESUMEloop closing
			if numFound == false then
				SITREP_statenum = 1
				SITREP_index = 1
				SITREP_state = "BUILDloop"
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdateSITREP has ended cycle, resetting SITREP_state to " .. SITREP_state))
				end
				if SuperdebugProcess == true then
					dumpTable("DAWS AIE  -  SITREPtable.lua", SITREPtable)
				end					
				SITREP_reset = true
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
			else
				SITREP_statenum = SITREP_statenum + 1
				SITREP_reset = false
				funcID_SITREP = timer.scheduleFunction(UpdateSITREP, {}, timer.getTime()+ updateShift)
			end			
		end
	end	
	--]]--
	
	
	--#####################################################
	--### E - planning for each group #####################
	--#####################################################		

	--[[ DEFINE PLANNING:
		Phases (repeated for each coalition to reduce cpu load):
			TERRloop 	- Reharse territory information, create a sitrep entry for each controlled territory (SET)
			INTELloop 	- Collect enemy intel info for each territory within 50 km from current SET
			ORBATloop 	- Assess allied groups class & strenght for SET
			RESUMEloop 	- Analyze collected data and update planning indexes

		riskFactor:
		+1 if enemy is stronger than ally * enemyForceFactor (RESUMEloop)
		+1 if enemy has arty units in range (INTELloop)
		
		
		notes: find a way to reduce enemyintel distances.
		
	--]]--			
	
	--PLANtable
	local PLAN_statenum = 1
	--local PLAN_phase = "A"
	--local PLAN_coa = "blue"
	--local PLAN_reset = false
	local funcID_PLAN = nil
	--local PLAN_index = 1		
	--local PLAN_timemin = timer.getAbsTime()+3600
	
	local UpdatePLAN = function() 
		local numFound = false
		
		--check dead groups
		for pId, pData in pairs(PLANtable) do
			local checkDead = true
			for _,unitData in pairs(mist.DBs.aliveUnits) do
				if pData.id == unitData.groupId and checkDead == true then
					checkDead = false
				end
			end
			if checkDead == true then
				table.remove(PLANtable,pId)
			end
		end
		
		for oId, oData in pairs(ORBATtable) do
			-- PLANloop cycle
			if oId == PLAN_statenum then
				numFound = true
				if debugProcess == true then
					env.info(("DAWS AIE  -  UpdatePLAN - Evaluatin group Group " .. oData.Name)) --, resetting SITREP_state to " .. SITREP_state
				end
				
				-- this will check if a planning is currently active for group
				local checkPlan = false
				for _, pData in pairs(PLANtable) do
					if oData.Id == pData.id then
						table.remove(PLANtable,pId) 
						checkPlan = true 
						if debugProcess == true then
							env.info(("DAWS AIE  -  UpdatePLAN - Group " .. oData.Name .. " is alread planned. Overwriting")) --, resetting SITREP_state to " .. SITREP_state
						end
					end
				end
				
				-- proceeed only no plan is currently on plot
				if checkPlan == false then
					if debugProcess == true then
						env.info(("DAWS AIE  -  UpdatePLAN - Group " .. oData.Name .. " is available for planning"))
					end							
					
					local GroupName = oData.Name
					local GroupId = oData.Id
					local GroupTerr = oData.Territory
					local GroupClass = oData.Class
					local GroupStrenght = oData.Strenght
					local GroupCoa = oData.Coalition
					local GroupTable = nil
					for _, unitData in pairs(mist.DBs.aliveUnits) do
						if unitData.groupId == GroupId then
							local uName = unitData.unitName
							GroupTable = Unit.getByName(uName):getGroup()
						end
					end

					if debugProcess == true then
						env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " is coalition " .. tostring(GroupCoa) .. ", class " .. tostring(GroupClass) .. ", strenght " .. tostring(GroupStrenght) .. " and located in " .. tostring(GroupTerr)))
					end								
					
					for sId, sData in pairs(SITREPtable) do
						if sData.name == GroupTerr then
							local sStatus = sData.status
							local sBorder = nil
							local sNearBorder = nil
							local sNeutralBorder = nil
							local sNearest = nil
							local sNearestDir = nil
							local sNearestAlly = nil
							local sNearestHasEnemy = false
							local sNearestDistance = nil
							local sImportant = nil
							local sImportantDir = nil
							local sImportantHasEnemy = false
							local sCurrentPos = nil
							local sAlliedTable = sData.alliedForces
							local sReconGroupAvail = false
							local sPriority = sData.priorityLevel
							local MissionPriority = 0
							
							for _, afData in pairs(sData.alliedForces) do
								if afData.groupClass == "REC" then
									sReconGroupAvail = true
								end
							end
							
							for _, eiData in pairs(sData.enemyIntel) do
								if eiData and eiData.nearest == true then
									sNearest = eiData.name
									sNearestDir = eiData.direction
									sNearestDistance = eiData.distance
									if debugProcess == true then
										env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " nearest territory is " .. tostring(sNearest) .. ", distance: " .. tostring(sNearestDistance) .. ", heading: " .. tostring(sNearestDir)))
									end												
									for iId, iData in pairs(INTELtable) do	
										if iData.unitTerr == sNearest then
											sNearestHasEnemy = true
											if debugProcess == true then
												env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " nearest territory has enemies"))
											end												
										end
									end
								end
								if eiData and eiData.mostimportant == true then
									sImportant = eiData.name	
									sImportantDir = eiData.direction
									if debugProcess == true then
										env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " most important territory is " .. tostring(sImportant) .. ", heading: " .. tostring(sImportantDir)))
									end										
									for iId, iData in pairs(INTELtable) do	
										if iData.unitTerr == sImportant then
											sImportantHasEnemy = true
											if debugProcess == true then
												env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " most important territory has enemies"))
											end												
										end
									end
								end									
							end	
							
							for tId, tData in pairs(TERRtable) do
								if tData.name == GroupTerr then								
									sBorder = isBorder
									sNearBorder = nearBorder
									sNeutralBorder = neutralBorder
									sCurrentPos = tData.point
									if debugProcess == true then
										env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " territory " .. tostring(GroupTerr) .. " position data: sBorder = " .. tostring(sBorder) .. ", sNearBorder " .. tostring(sNearBorder) .. ", sNeutralBorder " .. tostring(sNeutralBorder)))
									end																		
									local minAllyDist = 10000000000
									for ntId, ntData in pairs(tData.nearTERRtable) do
										if ntData.owner == oData.Coalition and ntData.distance < minAllyDist then
											minAllyDist = ntData.distance
											sNearestAlly = ntData.name
										end
									end									
									if sNearestAlly == nil then
										local escapeDir = nil
										if sNearestDir and sNearestDir == "north" then
											escapeDir = "south"
										elseif sNearestDir and sNearestDir == "south" then
											escapeDir = "north"
										elseif sNearestDir and sNearestDir == "east" then
											escapeDir = "west"
										elseif sNearestDir and sNearestDir == "west" then
											escapeDir = "east"
										end											
										for ntId, ntData in pairs(nearTERRtable) do
											if escapeDir and ntId == escapeDir and ntData.distance < minAllyDist then
												minAllyDist = ntData.distance
												sNearestAlly = ntData.name
											end
										end											
									end										
								end
							end
							
							if debugProcess == true then
								env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " nearest allied territory is " .. tostring(sNearestAlly)))
							end		

							if debugProcess == true then
								env.info(("DAWS AIE  -  UpdatePLAN - Group " .. tostring(GroupName) .. " current territory status is " .. tostring(sStatus)))
							end									

							-- logic for far away enemy. Evaluate nearest territory and move forward.
							if sStatus == "enemyFar" then
								-- enemyFar plan
								if sImportant or sNearest then
									if GroupClass == "MBT" then
										if sImportantHasEnemy == false then
											addPlanning(GroupTable, GroupId, GroupCoa, "B", GroupTerr, sImportant, nil, MissionPriority)												
										elseif sNearestHasEnemy == false then
											addPlanning(GroupTable, GroupId, GroupCoa, "B", GroupTerr, sNearest, nil, MissionPriority)
										else 
											for xtId, xtData in pairs(TERRtable) do
												if GroupTerr == xtData.name then
													for tpDir, tpData in pairs(xtData.nearTERRtable) do
														if tpDir == sImportantDir or tpDir == sNearestDir then
															if tpData.owner == GroupCoa then
																addPlanning(GroupTable, GroupId, GroupCoa, "J", GroupTerr, tpData.name, nil, MissionPriority)
															else
																addPlanning(GroupTable, GroupId, GroupCoa, "B", GroupTerr, tpData.name, nil, MissionPriority)
															end
														end
													end
												end
											end
										end										
									
									elseif GroupClass == "IFV" or GroupClass == "ATGM" then
										if sImportantHasEnemy == false then
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sImportant, nil, MissionPriority)												
										elseif sNearestHasEnemy == false then
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearest, nil, MissionPriority)
										else 
											for xtId, xtData in pairs(TERRtable) do
												if GroupTerr == xtData.name then
													for tpDir, tpData in pairs(xtData.nearTERRtable) do
														if tpDir == sImportantDir or tpDir == sNearestDir then
															if tpData.owner == GroupCoa then
																addPlanning(GroupTable, GroupId, GroupCoa, "J", GroupTerr, tpData.name, nil, MissionPriority)
															else
																addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, tpData.name, nil, MissionPriority)
															end
														end
													end
												end
											end
										end
										
									elseif GroupClass == "REC" then											
										-- identify allied arty groups
										local artyhere = false
										for _, afsData in pairs(sAlliedTable) do
											if afsData.groupClass == "ARTY" or afsData.groupClass == "MRLS" then
												artyhere = true
											end											
										end											
										if sNearestHasEnemy and sNearestHasEnemy == true and artyhere == true and sNearestDistance and sNearestDistance < 12000 then
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearest, nil, MissionPriority)	
										elseif sNearestHasEnemy and sNearestHasEnemy == false then
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearest, nil, MissionPriority)
										elseif sImportantHasEnemy and sImportantHasEnemy == true then
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sImportant, nil, MissionPriority)
										end
									
									elseif GroupClass == "ARTY" or GroupClass == "MRLS" then	
										--move arty nearer to the enemy
										if sNearestHasEnemy and sNearestHasEnemy == true and sNearestDistance and sNearestDistance > 12000 then
											local distance = sNearestDistance - 9000
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearest, distance, MissionPriority)
										elseif sBorder == false then
											-- check nearest territory "nearborder"
											local mindistance = 10000000
											local destination = nil
											for tId, tData in pairs(TERRtable) do
												if tData.isBorder == true and blueforce == 0 and sCurrentPos then
													local distance = mist.utils.get3DDist(sCurrentPos, tData.point)
													if distance < mindistance and distance > 0 then
														destination = tData.name
														mindistance = distance
													end										
													
												elseif tData.isBorder == true and blueforce > 0 and sCurrentPos then
													local hasArty = false
													for oId, oData in pairs(ORBATtable) do
														if oData.Territory == tData.name then
															if oData.Class == "ARTY" or oData.Class == "MRLS" then
																hasArty = true
															end
														end
													end
													if hasArty == false then
														local distance = mist.utils.get3DDist(sCurrentPos, tData.point)
														if distance < mindistance and distance > 0 then
															destination = tData.name
															mindistance = distance
														end															
													end
												end	
											end
											if destination ~= nil then
												local distance = mindistance - 9000
												addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, destination, distance, MissionPriority)
											end
										end
									end
								else
									if debugProcess == true then
										env.info(("DAWS AIE  -  UpdatePLAN - sNearest and sImportant doesn't exist for " .. GroupTerr))
									end										
								end

							elseif sStatus == "enemyNear" or sStatus == "battle" then
								if debugProcess == true then
									env.info(("DAWS AIE  -  UpdatePLAN has status: " .. sStatus)) 
								end						
								-- enemyNear/battle plan
								if sImportant or sNearest then							
									local manouver = "none"
									local skr_diff = 1
									local rgn_diff = 1																	
									if sData.enemy_skirmish > 0 then
										skr_diff = sData.allied_skirmish/sData.enemy_skirmish
									else
										skr_diff = 1.5 -- imposed
									end
									if sData.enemy_range > 0 then
										rgn_diff = sData.allied_range/sData.enemy_range
									else
										rgn_diff = 1.5 -- imposed
									end										
									
									if skr_diff > 1.2 and rgn_diff > 1.2 then
										manouver = "attack"
									elseif skr_diff < 0.8 and rgn_diff < 0.8 then
										manouver = "retreat"
									elseif skr_diff < 0.9 and rgn_diff > 1.1 then
										manouver = "contact"
									elseif skr_diff > 1.1 and rgn_diff < 0.9 then
										manouver = "brkLOS"
									end										
									if manouver == "attack" then
										if GroupClass == "IFV" or GroupClass == "ATGM" or GroupClass == "MBT" then
											addPlanning(GroupTable, GroupId, GroupCoa, "B", GroupTerr, sNearest, nil, MissionPriority)
										elseif GroupClass == "REC" then	
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearest, nil, MissionPriority)
										end			
									elseif manouver == "retreat" then
										if GroupClass == "IFV" or GroupClass == "ATGM" or GroupClass == "MBT" then
											addPlanning(GroupTable, GroupId, GroupCoa, "B", GroupTerr, sNearestAlly, nil, MissionPriority)
										elseif GroupClass == "REC" then	
											addPlanning(GroupTable, GroupId, GroupCoa, "E", GroupTerr, sNearestAlly, nil, MissionPriority)
										elseif GroupClass == "ARTY" or GroupClass == "MRLS" then	
											addPlanning(GroupTable, GroupId, GroupCoa, "B", GroupTerr, sNearestAlly, nil, MissionPriority)
										end										
									elseif manouver == "contact" then
										if GroupClass == "REC" and sReconGroupAvail == true then	
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearest, nil, MissionPriority)
										elseif GroupClass == "IFV" or GroupClass == "ATGM" or GroupClass == "MBT" and sReconGroupAvail == false then
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearest, nil, MissionPriority)
										end										
									elseif manouver == "brkLOS" then
										if GroupClass == "IFV" or GroupClass == "ATGM" or GroupClass == "MBT" then
											addPlanning(GroupTable, GroupId, GroupCoa, "E", GroupTerr, sNearestAlly, nil, MissionPriority)
										elseif GroupClass == "REC" then	
											addPlanning(GroupTable, GroupId, GroupCoa, "E", GroupTerr, sNearestAlly, nil, MissionPriority)
										elseif GroupClass == "ARTY" or GroupClass == "MRLS" then	
											addPlanning(GroupTable, GroupId, GroupCoa, "A", GroupTerr, sNearestAlly, 10000, MissionPriority)
										end										
									
									end										
								end								
							end 
						end
					end
				end
				--]]--
			end
		end
		
		-- PLANloop closing
		if numFound == false then
			PLAN_statenum = 1
			timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
			if debugProcess == true or debugProcessPLAN == true then
				env.info(("DAWS AIE  -  UpdatePLAN has ended cycle")) 
			end
			--[[
			if SuperdebugProcess == true then
				dumpTable("DAWS AIE  -  PLANtable.lua", PLANtable)
			end
			--]]--
			--SITREP_reset = true
		else
			PLAN_statenum = PLAN_statenum + 1
			--[[
			if debugProcess == true or debugProcessPLAN == true then
				env.info(("DAWS AIE  -  UpdatePLAN Statenum: ".. PLAN_statenum)) 
			end
			--SITREP_reset = false
			--]]--
			funcID_PLAN = timer.scheduleFunction(UpdatePLAN, {}, timer.getTime()+ updateShift)
		end				
	end
	--]]--
	

	
	--#####################################################
	--### F - Scheduler ###################################
	--#####################################################
	
	--SCHEDtable
	local SCHED_statenum_blue = 0
	local SCHED_statenum_red = 0
	local SCHED_phase = "init"
	local funcID_SCHED = nil
	local TEMPPLANtable = {}
	
	local Scheduler = function()
		local numFound = false			
		
		if SCHED_phase == "init" then				
			TEMPPLANtable = PLANtable
			PLANtable = {}
			SCHED_statenum = 1
			SCHED_phase = "A"
			timer.scheduleFunction(Scheduler, {}, timer.getTime()+ updateShift)
			--
			if debugProcess == true or debugProcessSCHED == true then
				env.info(("DAWS AIE  -  Scheduler has ended init phase")) 
			end
			--]]--
		
		elseif SCHED_phase == "A" then
			
			-- SCHED_phase A cycle
			local reAddPlanning = function(Coa)			
				numFound = true
				local maxPriority = -1
				local choosedPi = nil						
				for tpId, tpData in pairs(TEMPPLANtable) do
					local priority = tpData.missionPriority
					if priority > maxPriority and tpData.coalition == Coa then
						maxPriority = priority
						choosedPi = tpId
					end
				end						
				for txpId, txpData in pairs(TEMPPLANtable) do
					if txpId == choosedPi then								
						PLANtable[#PLANtable+1] = txpData
						table.remove(TEMPPLANtable, txpId)								
						if debugProcess == true or debugProcessSCHED == true then
							env.info(("DAWS AIE  -  Scheduler re-adding to PLANtable group " .. txpData.group .. ", Coalition " .. Coa)) 
						end
						choosedPi = nil
					end
				end
			end
			
			if SCHED_statenum <= numberMovLimit then
				numFound = true
				reAddPlanning("blue")
				reAddPlanning("red")
			end
			
			-- SCHED_phase A closing
			if numFound == false then
				SCHED_statenum = 1
				SCHED_phase = "B"
				timer.scheduleFunction(Scheduler, {}, timer.getTime()+ updateShift)
				if SuperdebugProcess == true then
					dumpTable("DAWS AIE  -  TEMPPLANtable.lua", TEMPPLANtable)
				end						
			else
				SCHED_statenum = SCHED_statenum + 1
				if debugProcess == true or debugProcessSCHED == true then
					env.info(("DAWS AIE  -  Scheduler cycle A Statenum: ".. SCHED_statenum)) 
				end
				funcID_SCHED = timer.scheduleFunction(Scheduler, {}, timer.getTime()+ updateShift)
			end	
		
		elseif SCHED_phase == "B" then
			-- SCHED_phase B cycle
			for pId, pData in pairs(PLANtable) do
				if pId == SCHED_statenum then
					numFound = true			
					local GroupTable = pData.groupTable
					local GroupName = pData.group
					local Id = pData.id
					local MissionType = pData.missiontype
					local destinationPlace_point = pData.toTERRpoint
					local range = pData.Range
					if debugProcess == true or debugProcessSCHED == true then
						env.info(("DAWS AIE  -  Scheduler executing mission for ".. GroupName .. ", timeshift: " .. tostring(ExeMissionTimeShift))) 
					end						
					ExeMission(GroupTable, Id, MissionType, destinationPlace_point, ExeMissionTimeShift, range)
					ExeMissionTimeShift = ExeMissionTimeShift + math.random(1,3)*60
					
				end
			end
		
			-- SCHED_phase B closing
			if numFound == false then
				SCHED_statenum = 1
				ExeMissionTimeShift = 0
				SCHED_phase = "init"
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
				TEMPPLANtable = {}
				if SuperdebugProcess == true then
					dumpTable("DAWS AIE  -  PLANtable.lua", PLANtable)
				end												
			else
				SCHED_statenum = SCHED_statenum + 1
				if debugProcess == true or debugProcessSCHED == true then
					env.info(("DAWS AIE  -  Scheduler cycle B Statenum: ".. SCHED_statenum)) 
				end
				funcID_SCHED = timer.scheduleFunction(Scheduler, {}, timer.getTime()+ updateShift)
			end					
		
		end
	end
	--]]--
	
	--#####################################################		
	--### Cycle functions #################################
	--#####################################################		
	
	-- GSC
	local globalStateChanger = function()
		if GlobalState == "A" then -- start looping state filter...
			GlobalState = "B"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "B" then
			GlobalState = "C"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "C" then
			GlobalState = "D"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "D" then
			GlobalState = "E" 
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "E" then
			GlobalState = "F"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "F" then
			GlobalState = "G"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "G" then
			GlobalState = "H"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "H" then
			GlobalState = "I"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "I" then
			GlobalState = "J"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "J" then
			GlobalState = "K"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger change state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)
		elseif GlobalState == "K" then -- this one close the loop and restart
			GlobalState = "A"
			if debugProcess == true then
				env.info(("DAWS AIE  -  globalStateChanger reset state to " .. GlobalState))
			end
			timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 1)				
		end
	end
	--]]--

	-- EPC
	local ExecutePeriodicCycle = function() 

		if GlobalState ~= PastGlobalState then

			if GlobalState == "A" then -- start looping state filter...
				if StatedebugProcess == true then
					env.info(("DAWS AIE  -  ExecutePeriodicCycle launched UpdateORBAT() cycle at time " .. timer.getAbsTime()))
				end						
				UpdateORBAT()
				PastGlobalState = "A"
			elseif GlobalState == "B" then
				if StatedebugProcess == true then
					env.info(("DAWS AIE  -  ExecutePeriodicCycle launched UpdateIntel() cycle at time " .. timer.getAbsTime()))
				end						
				UpdateIntel()
				PastGlobalState = "B"
			elseif GlobalState == "C" then
				if StatedebugProcess == true then
					env.info(("DAWS AIE  -  ExecutePeriodicCycle launched UpdateOwnership() cycle at time " .. timer.getAbsTime()))
				end
				UpdateOwnership()
				PastGlobalState = "C"
			elseif GlobalState == "D" then
				if StatedebugProcess == true then
					env.info(("DAWS AIE  -  ExecutePeriodicCycle launched UpdateSITREP() cycle at time " .. timer.getAbsTime()))
				end					
				UpdateSITREP()
				PastGlobalState = "D"
			elseif GlobalState == "E" then
				if StatedebugProcess == true then
					env.info(("DAWS AIE  -  ExecutePeriodicCycle launched UpdatePLAN() cycle at time " .. timer.getAbsTime()))
				end	
				UpdatePLAN()
				PastGlobalState = "E"
			elseif GlobalState == "F" then
				if StatedebugProcess == true then
					env.info(("DAWS AIE  -  ExecutePeriodicCycle launched Scheduler() cycle at time " .. timer.getAbsTime()))
				end	
				Scheduler()
				PastGlobalState = "F"
			elseif GlobalState == "G" then
				--placeholder
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
				--]]--
				PastGlobalState = "G"
			elseif GlobalState == "H" then  
				--placeholder
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
				--]]--
				PastGlobalState = "H"
			elseif GlobalState == "I" then   
				--placeholder
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
				--]]--
				PastGlobalState = "I"
			elseif GlobalState == "J" then 
				--placeholder
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
				--]]--
				PastGlobalState = "J"
			elseif GlobalState == "K" then 
				--placeholder
				timer.scheduleFunction(globalStateChanger, {}, timer.getTime() + 1)
				--]]--
				PastGlobalState = "K"
			end
		end

	end
	--]]--		
	

	--Initialization
	timer.scheduleFunction(ExecutePeriodicCycle, {}, timer.getTime() + 30)
	

	env.info(("DAWS AI Enhancement version - Dynamic Ground War loaded"))
	-- ~=
	
