What i gave you isn't the whole code
That's OK, because the answers I gave aren't complete either.
If the code is much bigger, what's the big deal about adding a few extra functions, and doing the job properly?
Variables are retrieved or referenced, but they are never called, unless the variables are function pointers.