NOTE TO SELF: FIX LUA CODE