Global variables are necessary, I think. I know they are hard to keep track of, but that is how programming can be sometimes. I don't know much C, so someone else would have to translate it to C.

Paul