Update main.lua

Adding a teeny weeny bit of a state system