Update lua

Just making the code a bit more Lua-ish.