Changed tempdata to use constants as indices
Included the 2 lines back