Very confused by LUA wiki classes example - please help explain

ok so ive been creating my classes set out by an example on the internet but recently been browsing through LUA wiki and came across a class example using metatables. Ive tried their method and cant get it to work, so if someone could please tell me what im doing wrong and also whats the difference performance wise between my old method and the newer. Ive included my method and the wiki way.

Many thanks.

 --MAIN  
  
local Account = require("Account") -- LUA example that does not work for me  
  
local Balloon = require("Balloon") -- a class I created using different method that works  
  
balloon = Balloon.new() -- plenty of joy  
  
acc = Account.create(1000) -- nope no joy ???  
acc:withdraw(100)  
  
--ACCOUNT CLASS from wiki  
  
Account = {}  
Account.\_\_index = Account  
  
function Account.create(balance)  
 local acnt = {} -- our new object  
 setmetatable(acnt,Account) -- make Account handle lookup  
 acnt.balance = balance -- initialize our object  
 return acnt  
end  
  
function Account:withdraw(amount)  
 self.balance = self.balance - amount  
end  
  

[code]
–BALLOON CLASS

local Balloon = {}

function Balloon.new()

local balloon = display.newImageRect( “balloon.png”, 100, 90 )
balloon.id = “balloon”

balloon.x = 200
balloon.y = 200

physics.addBody( balloon, “dynamic”, { density=0.2, friction=1, bounce=0.0, radius=40 } )
balloon.rotation = 0
balloon.isFixedRotation = true

balloon.health = 100

function balloon:addForce(wind, hotAir)
balloon:applyForce( wind, hotAir, 20, balloon.y )
end

function balloon:applyImpulse(wind, hotAir)
balloon:applyLinearImpulse( wind, hotAir, 20, balloon.y )
end

function balloon:getVelocity()

vx, vy = balloon:getLinearVelocity()

return vy
end

function balloon:destroy()

balloon:removeSelf()
balloon = nil
end

return balloon

end

return Balloon
[/code] [import]uid: 118379 topic_id: 21582 reply_id: 321582[/import]

you are not returning Account in your account class on the last line.
[import]uid: 3826 topic_id: 21582 reply_id: 85680[/import]

Cool, makes sense. Was too tied to notice the difference or think logically at the time. If you know could you please tell what the benefits if any, of the metatables method are compared to my original? It would be nice to know, I would like to make sure all my code is done the best way possible. Thanks. [import]uid: 118379 topic_id: 21582 reply_id: 85841[/import]