Why wont this table work?

Trying to put these notes into a table, then delete them. They will not delete?

[lua]hit = 0
txt = display.newText(score, 200, 10, system.DefaultFont, 25)
txt:setTextColor(“193”,“42”,“221”)
_G.r = media.newRecording()
r:startTuner()

if r then
if r:isRecording() then
r:stopRecording()
end
end
print(r:isRecording())
notesnum = 0
first = true
local line = display.newLine(150, 66, 150, 270)
line:setColor(255, 0, 0)
display.setStatusBar( display.HiddenStatusBar )

notes = {
{note=“d”, freq=“146”, top=“293”, more=“587”, posy=“221”, rot=false, sound=“media/d.wav”},
{note=“e”, freq=“164”, top=“329”, more=“659”, posy=“200”, rot=false, sound =“media/e.wav”},
{note=“f”, freq=“174”, top=“349”, more=“698”, posy=“175”, rot=false, sound=“media/f.wav”},
{note=“g”, freq=“196”, top=“392”, more=“783”, posy=“153”, rot=false, sound=“media/g.wav”},
{note=“a”, freq=“220”, top=“440”, more=“55”, posy=“124”, rot=false, sound=“media/a.wav”},
{note=“b”, freq=“246”, top=“493”, more=“61”, posy=“230”, rot=true, sound=“media/b.wav”},
{note=“c”, freq=“261”, top=“523”, more=“65”, posy=“211”, rot=true, sound=“media/c.wav”},
{note=“d2”, freq=“293”, top=“587”, more=“146”, posy=“185”, rot=true , sound=“media/d.wav”},
{note=“e2”, freq=“329”, top=“659”, more=“164”, posy=“159”, rot=true , sound=“media/e.wav”},
{note=“f2”, freq=“349”, top=“698”, more=“174”,posy=“130”, rot=true, sound=“media/f.wav”},
{note=“g2”, freq=“392”, top=“783”, more=“196”,posy=“110”, rot=true, sound=“media/g.wav”}
}


dec = “3”

i = notes[1]

for g = 1, #notes, 1 do
_G[“note”…g] = audio.loadSound( notes[g].sound)
print( )
end


local noteTable = {}
function note(index, number)
local note = display.newImage(“newnote.png”)
localGroup:insert(note)

function noteDelete()
NoteTable[number]:removeSelf()
note = nil
notesnum = notesnum - 1
end
if notes[index].rot == true then
note:rotate(180)
end
note.x=500
note.y= notes[index].posy

freq1 = notes[index].freq
top1 = notes[index].top
more1 = notes[index].more

function check(event)
f = r:getTunerFrequency()
if f < freq1 + 30 and f > freq1 - 30 or f < top1 + 30 and f > top1 - 30 or f < more1 + 10 and f > more1 - 10 then

x = nil
hit = 0
noteDelete()
f = nil
_G.score = _G.score + 1
txt.text = score
end
return true
end
Runtime:addEventListener(“enterFrame”, check)

local function move()
if note then
note.x = note.x - 8
if note.x < 110 then

timer.cancel(time1)
note:removeSelf()
timer.cancel(time)
director:changeScene(“over”, “moveFromBottom”)
end
end
end

time1 = timer.performWithDelay(20, move, -1)

return note
end
newNote = function(e)
number = #notes + 1
noteTable[number] = note(e, number)
end
local function newnot()
que = {
ode = {6, 6, 7, 8, 8, 7, 6, 5, 4, 4, 5, 6, 6, 5, 5, 6, 6, 7, 8, 8, 7, 6, 5, 4, 4, 5, 6, 5, 4, 4},

joy = {7, 6, 5, 4, 3, 2, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 6, 5, 4, 4, 2, 7, 7, 6, 5, 4, 4, 2, 7},

buns = {5, 4, 3, 5, 4, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 4, 3},

day = {4, 4, 5, 4, 7, 6, 4, 4, 5, 4, 8, 7, 4, 4, 11, 9, 7, 6, 5, 10, 10, 9, 7, 8, 7},

land = {4, 5, 6, 7, 7, 7, 4, 5, 6, 6, 1, 4, 6, 5, 5, 5, 4, 5, 6, 6, 4, 5, 6, 7, 7, 7, 4, 5, 6, 6, 5, 4, 5, 5, 5, 1, 1, 2, 2, 5},

star = {1, 1, 1, 4, 8, 7, 6, 5, 11, 8, 7, 6, 5, 11, 8, 7, 6, 7, 5}

}

if first == true then
nexz = 0
end
nexz = nexz + 1
nexer = que[_G.concert]
nex = nexer[nexz]

print(nex)
if nex == nil then
director:changeScene(“songs”)
end

if first == true then
if r:isRecording() == false then
audio.play(_G[“note”…nex]);
else
r:stopRecording()
audio.play(_G[“note”…nex]);

end
end
local function resume()

r:startRecording()
timer.resume( time )
newNote(nex)
print(“resuming”)
end

if first == true then

timer.pause( time )
print(“paused”)
timer.performWithDelay(“2000”, resume)
first = false
else
newNote(nex)
end
last = nex
end
time = timer.performWithDelay(1000, newnot, -1)[/lua]

Thanks! [import]uid: 59735 topic_id: 22040 reply_id: 322040[/import]