main.lua modified