remove_rural_goods_produced = {
	remove_province_modifier = rural_goods_produced_1
	remove_province_modifier = rural_goods_produced_2
	remove_province_modifier = rural_goods_produced_3
	remove_province_modifier = rural_goods_produced_4
	remove_province_modifier = rural_goods_produced_5
	remove_province_modifier = rural_goods_produced_6
	remove_province_modifier = rural_goods_produced_7
	remove_province_modifier = rural_goods_produced_8
	remove_province_modifier = rural_goods_produced_9
	remove_province_modifier = rural_goods_produced_10
	remove_province_modifier = rural_goods_produced_11
	remove_province_modifier = rural_goods_produced_12
	remove_province_modifier = rural_goods_produced_13
	remove_province_modifier = rural_goods_produced_14
	remove_province_modifier = rural_goods_produced_15
	remove_province_modifier = rural_goods_produced_16
	remove_province_modifier = rural_goods_produced_17
	remove_province_modifier = rural_goods_produced_18
	remove_province_modifier = rural_goods_produced_19
	remove_province_modifier = rural_goods_produced_20
}

remove_urban_goods_produced = {
	remove_province_modifier = urban_goods_produced_1
	remove_province_modifier = urban_goods_produced_2
	remove_province_modifier = urban_goods_produced_3
	remove_province_modifier = urban_goods_produced_4
	remove_province_modifier = urban_goods_produced_5
	remove_province_modifier = urban_goods_produced_6
	remove_province_modifier = urban_goods_produced_7
	remove_province_modifier = urban_goods_produced_8
	remove_province_modifier = urban_goods_produced_9
	remove_province_modifier = urban_goods_produced_10
	remove_province_modifier = urban_goods_produced_11
	remove_province_modifier = urban_goods_produced_12
	remove_province_modifier = urban_goods_produced_13
	remove_province_modifier = urban_goods_produced_14
	remove_province_modifier = urban_goods_produced_15
	remove_province_modifier = urban_goods_produced_16
	remove_province_modifier = urban_goods_produced_17
	remove_province_modifier = urban_goods_produced_18
	remove_province_modifier = urban_goods_produced_19
	remove_province_modifier = urban_goods_produced_20
}

remove_mining_goods_produced = {
	remove_province_modifier = mining_goods_produced_1
	remove_province_modifier = mining_goods_produced_2
	remove_province_modifier = mining_goods_produced_3
	remove_province_modifier = mining_goods_produced_4
	remove_province_modifier = mining_goods_produced_5
	remove_province_modifier = mining_goods_produced_6
	remove_province_modifier = mining_goods_produced_7
	remove_province_modifier = mining_goods_produced_8
	remove_province_modifier = mining_goods_produced_9
	remove_province_modifier = mining_goods_produced_10
	remove_province_modifier = mining_goods_produced_11
	remove_province_modifier = mining_goods_produced_12
	remove_province_modifier = mining_goods_produced_13
	remove_province_modifier = mining_goods_produced_14
	remove_province_modifier = mining_goods_produced_15
	remove_province_modifier = mining_goods_produced_16
	remove_province_modifier = mining_goods_produced_17
	remove_province_modifier = mining_goods_produced_18
	remove_province_modifier = mining_goods_produced_19
	remove_province_modifier = mining_goods_produced_20
}

remove_plantage_goods_produced = {
	remove_province_modifier = plantage_goods_produced_1
	remove_province_modifier = plantage_goods_produced_2
	remove_province_modifier = plantage_goods_produced_3
	remove_province_modifier = plantage_goods_produced_4
	remove_province_modifier = plantage_goods_produced_5
	remove_province_modifier = plantage_goods_produced_6
	remove_province_modifier = plantage_goods_produced_7
	remove_province_modifier = plantage_goods_produced_8
	remove_province_modifier = plantage_goods_produced_9
	remove_province_modifier = plantage_goods_produced_10
	remove_province_modifier = plantage_goods_produced_11
	remove_province_modifier = plantage_goods_produced_12
	remove_province_modifier = plantage_goods_produced_13
	remove_province_modifier = plantage_goods_produced_14
	remove_province_modifier = plantage_goods_produced_15
	remove_province_modifier = plantage_goods_produced_16
	remove_province_modifier = plantage_goods_produced_17
	remove_province_modifier = plantage_goods_produced_18
	remove_province_modifier = plantage_goods_produced_19
	remove_province_modifier = plantage_goods_produced_20
}

add_export_effect = {
	#Rural_Exports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_rural_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_exports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_rural_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_rural_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_exports_2
			add_country_modifier = {
				name = GE_rural_trade_deal_exports_1
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_rural_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_rural_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_exports_1
			remove_country_modifier = GE_rural_trade_deal_exports_3
			add_country_modifier = {
				name = GE_rural_trade_deal_exports_2
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_rural_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_rural_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_exports_2
			remove_country_modifier = GE_rural_trade_deal_exports_4
			add_country_modifier = {
				name = GE_rural_trade_deal_exports_3
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_rural_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_rural_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_exports_3
			remove_country_modifier = GE_rural_trade_deal_exports_5
			add_country_modifier = {
				name = GE_rural_trade_deal_exports_4
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_rural_trade
					value = 5
				}
			}
			remove_country_modifier = GE_rural_trade_deal_exports_4
			add_country_modifier = {
				name = GE_rural_trade_deal_exports_5
				duration = -1
			}
		}
	#}
	#urban_Exports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_urban_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_exports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_urban_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_urban_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_exports_2
			add_country_modifier = {
				name = GE_urban_trade_deal_exports_1
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_urban_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_urban_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_exports_1
			remove_country_modifier = GE_urban_trade_deal_exports_3
			add_country_modifier = {
				name = GE_urban_trade_deal_exports_2
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_urban_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_urban_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_exports_2
			remove_country_modifier = GE_urban_trade_deal_exports_4
			add_country_modifier = {
				name = GE_urban_trade_deal_exports_3
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_urban_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_urban_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_exports_3
			remove_country_modifier = GE_urban_trade_deal_exports_5
			add_country_modifier = {
				name = GE_urban_trade_deal_exports_4
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_urban_trade
					value = 5
				}
			}
			remove_country_modifier = GE_urban_trade_deal_exports_4
			add_country_modifier = {
				name = GE_urban_trade_deal_exports_5
				duration = -1
			}
		}
	#}
	#mining_Exports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_mining_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_exports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_mining_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_mining_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_exports_2
			add_country_modifier = {
				name = GE_mining_trade_deal_exports_1
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_mining_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_mining_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_exports_1
			remove_country_modifier = GE_mining_trade_deal_exports_3
			add_country_modifier = {
				name = GE_mining_trade_deal_exports_2
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_mining_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_mining_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_exports_2
			remove_country_modifier = GE_mining_trade_deal_exports_4
			add_country_modifier = {
				name = GE_mining_trade_deal_exports_3
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_mining_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_mining_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_exports_3
			remove_country_modifier = GE_mining_trade_deal_exports_5
			add_country_modifier = {
				name = GE_mining_trade_deal_exports_4
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_mining_trade
					value = 5
				}
			}
			remove_country_modifier = GE_mining_trade_deal_exports_4
			add_country_modifier = {
				name = GE_mining_trade_deal_exports_5
				duration = -1
			}
		}
	#}
	#plantation_Exports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_plantation_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_exports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_plantation_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_plantation_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_exports_2
			add_country_modifier = {
				name = GE_plantation_trade_deal_exports_1
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_plantation_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_plantation_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_exports_1
			remove_country_modifier = GE_plantation_trade_deal_exports_3
			add_country_modifier = {
				name = GE_plantation_trade_deal_exports_2
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_plantation_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_plantation_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_exports_2
			remove_country_modifier = GE_plantation_trade_deal_exports_4
			add_country_modifier = {
				name = GE_plantation_trade_deal_exports_3
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_plantation_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_outgoing_plantation_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_exports_3
			remove_country_modifier = GE_plantation_trade_deal_exports_5
			add_country_modifier = {
				name = GE_plantation_trade_deal_exports_4
				duration = -1
			}
		}
		else_if = {
			limit = {
				check_variable = {
					which = GE_num_of_outgoing_plantation_trade
					value = 5
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_exports_4
			add_country_modifier = {
				name = GE_plantation_trade_deal_exports_5
				duration = -1
			}
		}
	#}
}

add_import_effect = {
	#Rural_Imports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_rural_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_imports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_rural_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_rural_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_imports_2
			add_country_modifier = {
				name = GE_rural_trade_deal_imports_1
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_rural_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_rural_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_imports_1
			remove_country_modifier = GE_rural_trade_deal_imports_3
			add_country_modifier = {
				name = GE_rural_trade_deal_imports_2
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_rural_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_rural_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_imports_2
			remove_country_modifier = GE_rural_trade_deal_imports_4
			add_country_modifier = {
				name = GE_rural_trade_deal_imports_3
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_rural_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_rural_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_rural_trade_deal_imports_3
			remove_country_modifier = GE_rural_trade_deal_imports_5
			add_country_modifier = {
				name = GE_rural_trade_deal_imports_4
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_rural_trade
					value = 5
				}
			}
			remove_country_modifier = GE_rural_trade_deal_imports_4
			remove_country_modifier = GE_rural_trade_deal_imports_6
			add_country_modifier = {
				name = GE_rural_trade_deal_imports_5
				duration = -1
			}
		}
	#}
	#Urban_Imports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_urban_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_imports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_urban_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_urban_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_imports_2
			add_country_modifier = {
				name = GE_urban_trade_deal_imports_1
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_urban_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_urban_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_imports_1
			remove_country_modifier = GE_urban_trade_deal_imports_3
			add_country_modifier = {
				name = GE_urban_trade_deal_imports_2
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_urban_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_urban_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_imports_2
			remove_country_modifier = GE_urban_trade_deal_imports_4
			add_country_modifier = {
				name = GE_urban_trade_deal_imports_3
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_urban_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_urban_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_urban_trade_deal_imports_3
			remove_country_modifier = GE_urban_trade_deal_imports_5
			add_country_modifier = {
				name = GE_urban_trade_deal_imports_4
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_urban_trade
					value = 5
				}
			}
			remove_country_modifier = GE_urban_trade_deal_imports_4
			remove_country_modifier = GE_urban_trade_deal_imports_6
			add_country_modifier = {
				name = GE_urban_trade_deal_imports_5
				duration = -1
			}
		}
	#}
	#Mining_Imports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_mining_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_imports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_mining_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_mining_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_imports_2
			add_country_modifier = {
				name = GE_mining_trade_deal_imports_1
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_mining_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_mining_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_imports_1
			remove_country_modifier = GE_mining_trade_deal_imports_3
			add_country_modifier = {
				name = GE_mining_trade_deal_imports_2
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_mining_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_mining_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_imports_2
			remove_country_modifier = GE_mining_trade_deal_imports_4
			add_country_modifier = {
				name = GE_mining_trade_deal_imports_3
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_mining_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_mining_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_mining_trade_deal_imports_3
			remove_country_modifier = GE_mining_trade_deal_imports_5
			add_country_modifier = {
				name = GE_mining_trade_deal_imports_4
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_mining_trade
					value = 5
				}
			}
			remove_country_modifier = GE_mining_trade_deal_imports_4
			remove_country_modifier = GE_mining_trade_deal_imports_6
			add_country_modifier = {
				name = GE_mining_trade_deal_imports_5
				duration = -1
			}
		}
	#}
	#Plantation_Imports {
		if = {
			limit = {
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_plantation_trade
						value = 1
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_imports_1
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_plantation_trade
					value = 1
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_plantation_trade
						value = 2
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_imports_2
			add_country_modifier = {
				name = GE_plantation_trade_deal_imports_1
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_plantation_trade
					value = 2
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_plantation_trade
						value = 3
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_imports_1
			remove_country_modifier = GE_plantation_trade_deal_imports_3
			add_country_modifier = {
				name = GE_plantation_trade_deal_imports_2
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_plantation_trade
					value = 3
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_plantation_trade
						value = 4
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_imports_2
			remove_country_modifier = GE_plantation_trade_deal_imports_4
			add_country_modifier = {
				name = GE_plantation_trade_deal_imports_3
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_plantation_trade
					value = 4
				}
				NOT = {
					check_variable = {
						which = GE_num_of_incoming_plantation_trade
						value = 5
					}
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_imports_3
			remove_country_modifier = GE_plantation_trade_deal_imports_5
			add_country_modifier = {
				name = GE_plantation_trade_deal_imports_4
				duration = -1
			}
		}
		if = {
			limit = {
				check_variable = {
					which = GE_num_of_incoming_plantation_trade
					value = 5
				}
			}
			remove_country_modifier = GE_plantation_trade_deal_imports_4
			remove_country_modifier = GE_plantation_trade_deal_imports_6
			add_country_modifier = {
				name = GE_plantation_trade_deal_imports_5
				duration = -1
			}
		}
	#}
}

GE_calculate_goods_produced_effect = {
	hidden_effect = {
		if = {
			limit = { total_development = 1 }
			set_variable = {
				which = GE_total_goods
				value = 0
			}
			#Rural = {
				every_owned_province = {
					export_to_variable = {
						variable_name = GE_total_goods_counter
						value = base_production
					}
					while = {
						limit = {
							check_variable = {
								which = GE_total_goods_counter
								value = 1
							}
						}
						change_variable = {
							which = GE_total_goods_counter
							value = -1
						}
						ROOT = {
							change_variable = {
								which = GE_total_goods
								value = 1
							}
						}
					}
				}
				set_variable = {
					which = GE_percentage_of_rural_goods
					value = 0
				}
				every_owned_province = {
					limit = {
						has_rural_goods = yes
					}
					export_to_variable = {
						variable_name = GE_rural_goods_counter
						value = base_production
					}
					while = {
						limit = {
							check_variable = {
								which = GE_rural_goods_counter
								value = 1
							}
						}
						change_variable = {
							which = GE_rural_goods_counter
							value = -1
						}
						ROOT = {
							change_variable = {
								which = GE_percentage_of_rural_goods
								value = 1
							}
						}
					}
				}
				multiply_variable = {
					which = GE_percentage_of_rural_goods
					value = 100
				}
				divide_variable = {
					which = GE_percentage_of_rural_goods
					which = GE_total_goods
				}
			#}
			#Urban = {
				set_variable = {
					which = GE_percentage_of_urban_goods
					value = 0
				}
				every_owned_province = {
					limit = {
						has_urban_goods = yes
					}
					export_to_variable = {
						variable_name = GE_urban_goods_counter
						value = base_production
					}
					while = {
						limit = {
							check_variable = {
								which = GE_urban_goods_counter
								value = 1
							}
						}
						change_variable = {
							which = GE_urban_goods_counter
							value = -1
						}
						ROOT = {
							change_variable = {
								which = GE_percentage_of_urban_goods
								value = 1
							}
						}
					}
				}
				multiply_variable = {
					which = GE_percentage_of_urban_goods
					value = 100
				}
				divide_variable = {
					which = GE_percentage_of_urban_goods
					which = GE_total_goods
				}
			#}
			#Mining = {
				set_variable = {
					which = GE_percentage_of_mining_goods
					value = 0
				}
				every_owned_province = {
					limit = {
						has_mining_goods = yes
					}
					export_to_variable = {
						variable_name = GE_mining_goods_counter
						value = base_production
					}
					while = {
						limit = {
							check_variable = {
								which = GE_mining_goods_counter
								value = 1
							}
						}
						change_variable = {
							which = GE_mining_goods_counter
							value = -1
						}
						ROOT = {
							change_variable = {
								which = GE_percentage_of_mining_goods
								value = 1
							}
						}
					}
				}
				multiply_variable = {
					which = GE_percentage_of_mining_goods
					value = 100
				}
				divide_variable = {
					which = GE_percentage_of_mining_goods
					which = GE_total_goods
				}
			#}
			#Plantation = {
				set_variable = {
					which = GE_percentage_of_plantation_goods
					value = 0
				}
				every_owned_province = {
					limit = {
						has_plantage_goods = yes
					}
					export_to_variable = {
						variable_name = GE_plantation_goods_counter
						value = base_production
					}
					while = {
						limit = {
							check_variable = {
								which = GE_plantation_goods_counter
								value = 1
							}
						}
						change_variable = {
							which = GE_plantation_goods_counter
							value = -1
						}
						ROOT = {
							change_variable = {
								which = GE_percentage_of_plantation_goods
								value = 1
							}
						}
					}
				}
				multiply_variable = {
					which = GE_percentage_of_plantation_goods
					value = 100
				}
				divide_variable = {
					which = GE_percentage_of_plantation_goods
					which = GE_total_goods
				}
			#}
		}
		else = {
			set_variable = {
				which = GE_total_goods
				value = 0
			}	
			set_variable = {
				which = GE_percentage_of_rural_goods
				value = 0
			}
			set_variable = {
				which = GE_percentage_of_mining_goods
				value = 0
			}
			set_variable = {
				which = GE_percentage_of_mining_goods
				value = 0
			}
			set_variable = {
				which = GE_percentage_of_plantation_goods
				value = 0
			}
		}
	}
}
