Double check the math on adding the elements to Temperature - very likely to be the culprit.
How many elements are then when the loop Completes?