app = {
    update = nil,
    stack = {},
}

function app.push(func)
    table.insert(app.stack, app.update)
       app.update = func
end

function app.pop()
    if #app.stack > 0 then
        app.update = table.remove(app.stack)
    end
end
