Mostly got app ported to Lua.