Help With Quest System

I am trying to create a quest system, but I have never used modules with a systemic approach. As can be seen, quest 1 refers to the dictionary before it finishes defining itself, which causes an error. At broad, how can I approach making a quest system in that way that this is intended to work? Since this is my first attempt, I’m sure I’ll make otherwise obvious mistakes, so how should I structure this? Aside from the error, is this format optimal? If not, what is a better way to approach this. Any feedback helps. Thanks!

local Players = game:GetService("Players")
local quests = {
	[1] = {
		description = "Go to mines",
		startQuest = function(player)
			workspace.Mine.A1.Touched:Connect(function(hit)
				if Players:GetPlayerFromCharacter(hit.Parent) == player then
					quests[2].startQuest()
				end
			end)
		end,
	},
	[2] = {
		description = "Mine 6 iron",
		startQuest = function(player)
			
		end,
	}
}
return quests

Hello, this format seems like it should work, however there are two issues I find with this. First, module scripts do not run any code by default, you have to call startQuest manually via another script, Secondly, if you are trying to call a function that has not been defined yet, consider moving Quest 2 to Quest 1 and putting it above, you cannot call a function and run code you haven’t written yet. Since Lua is a procedural programming language, it will start and line 1 and move down, you haven’t set the value [2] equal to anything yet, so it errors.