Improved mean_var Lua class