rename State.getIndex to State.getVar in preparation for abstract
definition of State