well the only thing is see is to change those () for [] when using array var.

After that... can't see what else it have to be modfied.