function compilation from Lua almost working