Added functions.lua to clear up main