added a method to get name of the variable given tag and num