function STATIONS_MAP_SETUP()
	local bounds = {0,0,0}
	local bounds=Universe_GetWorldBounds()
	local radius = bounds[1] -500
	--print(radius)
	local idxer = 0
	SobGroup_Create("ALLSTATIONS")
	Volume_AddSphere("TheUniverse", {0,0,0}, radius)
	while idxer < (ROUTES*2) do
		NAV_points=idxer
		--print(NAV_points.." of " ..ROUTES)
		SobGroup_Create("STATION"..NAV_points)
		--print("created group")
		Volume_AddSphere("NAV_"..NAV_points, {RandomRange(-1*radius,radius),RandomRange(-1*radius,radius),RandomRange(-1*radius,radius)}, 5000)
		--print("added volume")
		x=RandomRange(0,1)
		--print("selected "..x)
		if (x < 0.25) then
		SobGroup_SpawnNewShipInSobGroup(-1,"PLAT_xq_1_platform","NewStation","ALLSTATIONS","NAV_"..NAV_points)
		elseif (x < 0.5) then
		SobGroup_SpawnNewShipInSobGroup(-1,"PLAT_golan_I_platform","NewStation","ALLSTATIONS","NAV_"..NAV_points)
		elseif (x < 0.75) then
		SobGroup_SpawnNewShipInSobGroup(-1,"PLAT_golan_II_platform","NewStation","ALLSTATIONS","NAV_"..NAV_points)
		--elseif (x < 1) then
		--SobGroup_SpawnNewShipInSobGroup(-1,"PLAT_golan_III_platform","NewStation","ALLSTATIONS","NAV_"..NAV_points)
		end
		--print("added sobgroup")
		SobGroup_SobGroupAdd("ALLSTATIONS", "STATION"..NAV_points)
		idxer=idxer+1
		--print("incremented")
	end
	NAV_points=RandomRange(0,ROUTES*2)
	--NewFreighterStarts()
	Rule_Remove("STATIONS_MAP_SETUP")	
end  

function StationCheck()
  	local playerIndex = 0
  	local playerCount = Universe_PlayerCount()
  	local captured = 0
  	local currentRU = 0
  	SobGroup_Create("tempcaptured")
	SobGroup_Create("captured")
  	while playerIndex < playerCount do
    		if Player_IsAlive(playerIndex) == 1 then
			SobGroup_FillShipsByType("tempcaptured", "Player_Ships"..playerIndex, "PLAT_xq_1_platform")
			SobGroup_SobGroupAdd("captured", "tempcaptured")
			SobGroup_FillShipsByType("tempcaptured", "Player_Ships"..playerIndex, "PLAT_golan_I_platform")
SobGroup_SobGroupAdd("captured", "tempcaptured")
			SobGroup_FillShipsByType("tempcaptured", "Player_Ships"..playerIndex, "PLAT_golan_II_platform")
SobGroup_SobGroupAdd("captured", "tempcaptured")
     			--SobGroup_FillCompare("captured","Player_Ships"..playerIndex,"ALLSTATIONS")
     			captured = SobGroup_Count("captured")
     			--print("player" .. playerIndex .. " has captured ".. captured.. "Stations.")
     			if captured>0 then
       				local currentRU = Player_GetRU(playerIndex)
				--print("current rus" .. currentRU)
				local captureRU = captured*stations_capture_ru
				--print("rus awarded" .. captureRU)
       				Player_SetRU(playerIndex, currentRU + captureRU)
      			end
      			SobGroup_Clear("captured")
    		end
    		playerIndex = playerIndex + 1
  	end      
end -- FreighterCheck