revised the test cases, cleaning up the Lua_state when the simulate is finished
revised the test cases, cleaning up the Lua_state when the simulate is finished