allowed numbers in the middle of variable names

* also reorganized code