I got it, it was quiet simple. You missed some = after var XYZ $numtok. It should look like this var XYZ = $numtok.
It works like charm now, really great work, thank you so much =)